From 35b0ed1b1422d50582fb7ef941e19de89211ffcf Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 3 Feb 2026 12:53:24 -0500 Subject: [PATCH 01/47] Switch to grpc instead of connectweb --- app/tier1.go | 15 +++---- client/client.go | 94 ++++++++++++++++++++++++++++++++++++++-- service/server.go | 106 ++++++++++++++++------------------------------ service/tier1.go | 92 ++++++++++++++++++++++++++++------------ sink/sinker.go | 1 + 5 files changed, 199 insertions(+), 109 deletions(-) diff --git a/app/tier1.go b/app/tier1.go index 04dd48013..e12ccae32 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -8,7 +8,6 @@ import ( "os" "time" - "connectrpc.com/connect" "github.com/streamingfast/bstream" "github.com/streamingfast/bstream/blockstream" "github.com/streamingfast/bstream/hub" @@ -21,7 +20,7 @@ import ( "github.com/streamingfast/shutter" "github.com/streamingfast/substreams/client" "github.com/streamingfast/substreams/metrics" - pbsubstreamsrpcv2connect "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" + pbsubstreamsrpcv2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" "github.com/streamingfast/substreams/reqctx" "github.com/streamingfast/substreams/service" "github.com/streamingfast/substreams/wasm" @@ -281,7 +280,7 @@ func (a *Tier1App) Run() error { }) go func() { - var infoServer pbsubstreamsrpcv2connect.EndpointInfoHandler + var infoServer pbsubstreamsrpcv2.EndpointInfoServer if a.modules.InfoServer != nil { a.logger.Info("waiting until info server is ready") infoServer = &InfoServerWrapper{a.modules.InfoServer} @@ -348,17 +347,17 @@ func (config *Tier1Config) Validate() error { return nil } -var _ pbsubstreamsrpcv2connect.EndpointInfoHandler = (*InfoServerWrapper)(nil) +var _ pbsubstreamsrpcv2.EndpointInfoServer = (*InfoServerWrapper)(nil) type InfoServerWrapper struct { - rpcInfoServer InfoServer + rpcInfoServer pbsubstreamsrpcv2.EndpointInfoServer } // Info implements pbsubstreamsrpcconnect.EndpointInfoHandler. -func (i *InfoServerWrapper) Info(ctx context.Context, req *connect.Request[pbfirehose.InfoRequest]) (*connect.Response[pbfirehose.InfoResponse], error) { - resp, err := i.rpcInfoServer.Info(ctx, req.Msg) +func (i *InfoServerWrapper) Info(ctx context.Context, req *pbfirehose.InfoRequest) (*pbfirehose.InfoResponse, error) { + resp, err := i.rpcInfoServer.Info(ctx, req) if err != nil { return nil, err } - return connect.NewResponse(resp), nil + return resp, nil } diff --git a/client/client.go b/client/client.go index 2525ba7d7..41d23e2fd 100644 --- a/client/client.go +++ b/client/client.go @@ -1,17 +1,22 @@ package client import ( + "context" "crypto/tls" "fmt" "log" "net/url" "os" "regexp" + "time" + "github.com/dustin/go-humanize" + _ "github.com/mostynb/go-grpc-compression/experimental/s2" + _ "github.com/mostynb/go-grpc-compression/lz4" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" + "github.com/streamingfast/logging/zapx" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" - "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.uber.org/zap" "go.uber.org/zap/zapcore" "golang.org/x/oauth2" @@ -21,6 +26,8 @@ import ( "google.golang.org/grpc/credentials/oauth" xdscreds "google.golang.org/grpc/credentials/xds" "google.golang.org/grpc/encoding/gzip" + _ "google.golang.org/grpc/encoding/gzip" + stats "google.golang.org/grpc/stats" _ "google.golang.org/grpc/xds" ) @@ -162,6 +169,68 @@ func (c *SubstreamsClientConfig) MarshalLogObject(encoder zapcore.ObjectEncoder) return nil } +type sizeLoggingHandler struct { + messageCount int + timeStart time.Time + + uncompressedBytes int + compressedBytes int + wireBytes int + lastReceivedTime time.Time + waitToReceive time.Duration +} + +func (h *sizeLoggingHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { + zlog.Info("gRPC client RPC started", zap.String("method", info.FullMethodName)) + return ctx +} + +func (h *sizeLoggingHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { + if inPayload, ok := rs.(*stats.InPayload); ok && inPayload != nil { + if h.messageCount == 0 { + h.timeStart = time.Now() + } + h.waitToReceive += time.Since(h.lastReceivedTime) + h.lastReceivedTime = time.Now() + h.messageCount++ + h.uncompressedBytes += inPayload.Length + h.compressedBytes += inPayload.CompressedLength + h.wireBytes += inPayload.WireLength + + if h.messageCount == 10000 { + secs := time.Since(h.timeStart).Seconds() + messagesPerSecond := float64(h.messageCount) / secs + compressedPercentage := 100.0 - (float64(h.compressedBytes) / float64(h.uncompressedBytes) * 100.0) + + zlog.Info( + "grpc io stats", + zap.Float64("msg_sec", messagesPerSecond), + zapx.HumanDuration("duration", time.Since(h.timeStart)), + zapx.HumanDuration("wait_to_receive", h.waitToReceive), + zap.String("compression_ratio", fmt.Sprintf("%.2f%%", compressedPercentage)), + zap.String("uncompressed", humanize.Bytes(uint64(h.uncompressedBytes))), + zap.String("compressed", humanize.Bytes(uint64(h.compressedBytes))), + zap.Int("uncompressed_bytes", h.uncompressedBytes), + zap.Int("compressed_bytes", h.compressedBytes), + ) + + h.timeStart = time.Now() + h.messageCount = 0 + h.uncompressedBytes = 0 + h.compressedBytes = 0 + h.wireBytes = 0 + h.waitToReceive = 0 + } + } +} + +func (h *sizeLoggingHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context { + return ctx +} + +func (h *sizeLoggingHandler) HandleConn(ctx context.Context, cs stats.ConnStats) { +} + type InternalClientFactory = func() (cli pbssinternal.SubstreamsClient, closeFunc func() error, callOpts []grpc.CallOption, headers Headers, err error) // NewSubstreamsClientConfig creates a new SubstreamsClientConfig using the provided options. @@ -285,7 +354,8 @@ func NewSubstreamsInternalClient(config *SubstreamsClientConfig) (cli pbssintern } } - dialOptions = append(dialOptions, grpc.WithStatsHandler(otelgrpc.NewClientHandler())) + sizeHandler := &sizeLoggingHandler{} + dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) zlog.Debug("getting connection", zap.String("endpoint", endpoint)) conn, err := dgrpc.NewExternalClientConn(endpoint, dialOptions...) @@ -354,12 +424,30 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close } } - dialOptions = append(dialOptions, grpc.WithStatsHandler(otelgrpc.NewClientHandler())) + sizeHandler := &sizeLoggingHandler{} + dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) + + //compressor := strings.ToLower(os.Getenv("GRPC_COMPRESSOR")) + //switch compressor { + //case "lz4": + // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(lz4.Name))) + //case "s2": + // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) + //case "zstd": + // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(zstd.Name))) + //case "gzip": + //case "none": + // dialOptions = append(dialOptions, grpc.WithCompressor(nil)) + //default: + // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) + //} + dialOptions = append(dialOptions, grpc.WithUserAgent(config.agent)) zlog.Debug("getting connection", zap.String("endpoint", endpoint)) conn, err = dgrpc.NewExternalClient(endpoint, dialOptions...) + if err != nil { return nil, nil, nil, nil, fmt.Errorf("unable to create external gRPC client: %w", err) } diff --git a/service/server.go b/service/server.go index 3c8eeaf3b..5e2fc628e 100644 --- a/service/server.go +++ b/service/server.go @@ -1,24 +1,20 @@ package service import ( - "context" - "net/http" "net/url" "strings" + "time" - "connectrpc.com/connect" - compress "github.com/klauspost/connect-compress/v2" + _ "github.com/mostynb/go-grpc-compression/experimental/s2" + _ "github.com/mostynb/go-grpc-compression/lz4" + _ "github.com/mostynb/go-grpc-compression/zstd" "github.com/streamingfast/dauth" - dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" dgrpcserver "github.com/streamingfast/dgrpc/server" - connectweb "github.com/streamingfast/dgrpc/server/connectrpc" "github.com/streamingfast/dgrpc/server/factory" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" - "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" - "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" "go.uber.org/zap" @@ -43,95 +39,65 @@ func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck d return options } -type streamHandlerV3 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error +type v3Adapter struct { + *Tier1Service +} -func (h streamHandlerV3) Blocks(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error { - return h(ctx, req, stream) +func (a *v3Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3.Stream_BlocksServer) error { + return a.BlocksV3(req, srv) } func ListenTier1( listenAddr string, svc *Tier1Service, - infoService pbsubstreamsrpcv2connect.EndpointInfoHandler, + infoService pbsubstreamsrpc.EndpointInfoServer, auth dauth.Authenticator, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, ) (err error) { - done := make(chan struct{}) - var servers []*connectweb.ConnectWebServer + done := make(chan any) + + var servers []dgrpcserver.Server for _, addr := range strings.Split(listenAddr, ",") { // note: some of these common options don't work with connectWeb options := GetCommonServerOptions(addr, logger, healthcheck) - - options = append(options, dgrpcserver.WithConnectInterceptor(dauthconnect.NewAuthInterceptor(auth, logger))) - options = append(options, dgrpcserver.WithConnectStrictContentType(false)) - options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv2connect.StreamName)) - options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) - options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) - - //todo: move compression to dgrpc :-( - - streamHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { - var o []connect.HandlerOption - for _, opt := range opts { - o = append(o, opt) - } - o = append(o, compress.WithAll(compress.LevelBalanced)) - return pbsubstreamsrpcv2connect.NewStreamHandler(svc, o...) - } - - streamHandlerGetterV3 := func(opts ...connect.HandlerOption) (string, http.Handler) { - handler := streamHandlerV3(svc.BlocksV3) - var o []connect.HandlerOption - for _, opt := range opts { - o = append(o, opt) - } - o = append(o, compress.WithAll(compress.LevelBalanced)) - return pbsubstreamsrpcv3connect.NewStreamHandler(handler, o...) - } - - handlerGetters := []connectweb.HandlerGetter{streamHandlerGetter, streamHandlerGetterV3} - + options = append(options, dgrpcserver.WithPostUnaryInterceptor(dauthgrpc.UnaryAuthChecker(auth, logger))) + options = append(options, dgrpcserver.WithPostStreamInterceptor(dauthgrpc.StreamAuthChecker(auth, logger))) + grpcServer := factory.ServerFromOptions(options...) + pbsubstreamsrpc.RegisterStreamServer(grpcServer.ServiceRegistrar(), svc) + pbsubstreamsrpcv3.RegisterStreamServer(grpcServer.ServiceRegistrar(), &v3Adapter{svc}) if infoService != nil { - infoHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { - - var o []connect.HandlerOption - for _, opt := range opts { - o = append(o, opt) - } - o = append(o, compress.WithAll(compress.LevelBalanced)) - out, outh := pbsubstreamsrpcv2connect.NewEndpointInfoHandler(infoService, o...) - return out, outh - } - handlerGetters = append(handlerGetters, infoHandlerGetter) + pbsubstreamsrpc.RegisterEndpointInfoServer(grpcServer.ServiceRegistrar(), infoService) } - - options = append(options, dgrpcserver.WithConnectPermissiveCORS()) - srv := connectweb.New(handlerGetters, options...) svc.OnTerminating(func(err error) { logger.Info("Tier1Service is terminating") - srv.Shutdown(err) + grpcServer.Shutdown(30 * time.Second) }) - servers = append(servers, srv) cleanAddr := strings.ReplaceAll(addr, "*", "") + servers = append(servers, grpcServer) go func() { - srv.Launch(cleanAddr) - done <- struct{}{} + grpcServer.Launch(cleanAddr) + close(done) }() } <-done for _, srv := range servers { - srv.Shutdown(nil) + srv.Shutdown(0) } - for _, srv := range servers { - <-srv.Terminated() - if e := srv.Err(); e != nil { - err = e - } - } + //GRRRRRRRRRRRRRR + //GRRRRRRRRRRRRRR + + //for _, srv := range servers { + // <-srv.Terminated() + // if e := srv.Err(); e != nil { + // err = e + // } + //} + //GRRRRRRRRRRRRRR + //GRRRRRRRRRRRRRR return } @@ -158,7 +124,7 @@ func ListenTier2( svc.OnTerminating(func(err error) { logger.Info("Tier2Service is terminating") - grpcServer.Shutdown(0) + grpcServer.Shutdown(30 * time.Second) }) done := make(chan struct{}) diff --git a/service/tier1.go b/service/tier1.go index 2ebd1e74c..10f37f4f3 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -11,6 +11,7 @@ import ( "net/http" "os" "regexp" + "slices" "strconv" "strings" "sync" @@ -40,7 +41,6 @@ import ( "github.com/streamingfast/substreams/orchestrator/plan" "github.com/streamingfast/substreams/orchestrator/work" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" - pbsubstreamsrpcv2connect "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "github.com/streamingfast/substreams/pipeline" @@ -56,7 +56,10 @@ import ( ttrace "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) @@ -64,7 +67,6 @@ var errShuttingDown = errors.New("endpoint is shutting down, please reconnect") type Tier1Service struct { *shutter.Shutter - pbsubstreamsrpcv2connect.UnimplementedStreamHandler activeRequestsWG sync.WaitGroup blockType string @@ -287,25 +289,39 @@ func NewTier1( return s, nil } -func (s *Tier1Service) BlocksV3( - ctx context.Context, - req *connect.Request[pbsubstreamsrpcv3.Request], - stream *connect.ServerStream[pbsubstreamsrpc.Response], -) error { - r := req.Msg +func metadataToHeader(ctx context.Context) http.Header { + md, _ := metadata.FromIncomingContext(ctx) + h := http.Header{} + for k, vvs := range md { + hk := http.CanonicalHeaderKey(k) + for _, vv := range vvs { + h.Add(hk, vv) + } + } + return h +} + +func (s *Tier1Service) Blocks(req *pbsubstreamsrpc.Request, srv pbsubstreamsrpc.Stream_BlocksServer) error { + ctx := srv.Context() + header := metadataToHeader(ctx) + protocol := "/sf.substreams.rpc.v2.Stream/Blocks" + return s.BlocksAny(ctx, req, header, protocol, nil, srv) +} - _, err := manifest.ApplyPackageTransformations(r.Package, false, r.Network, r.OutputModule, r.Params) +func (s *Tier1Service) BlocksV3(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3.Stream_BlocksServer) error { + _, err := manifest.ApplyPackageTransformations(req.Package, false, req.Network, req.OutputModule, req.Params) if err != nil { - return err + return status.Errorf(codes.InvalidArgument, "%v", err) } - - ctx = reqctx.WithSpkg(ctx, r.Package) // passing by context is simpler for now, this could be cleaned up - reqV2, err := r.ToV2() + ctx := srv.Context() + ctx = reqctx.WithSpkg(ctx, req.Package) + v2req, err := req.ToV2() if err != nil { - return fmt.Errorf("failed to convert request to v2: %w", err) + return status.Errorf(codes.InvalidArgument, "failed to convert request to v2: %s", err) } - - return s.BlocksAny(ctx, reqV2, req.Header(), "/sf.substreams.rpc.v3.Stream/Blocks", r.Package, stream) + header := metadataToHeader(ctx) + protocol := "/sf.substreams.rpc.v3.Stream/Blocks" + return s.BlocksAny(ctx, v2req, header, protocol, req.Package, srv) } type usedStore struct { @@ -331,27 +347,46 @@ func (s *UsedFoundationalStore) MarshalLogObject(e zapcore.ObjectEncoder) error return nil } -func (s *Tier1Service) Blocks( - ctx context.Context, - req *connect.Request[pbsubstreamsrpc.Request], - stream *connect.ServerStream[pbsubstreamsrpc.Response], -) (serverErr error) { - return s.BlocksAny(ctx, req.Msg, req.Header(), "/sf.substreams.rpc.v2.Stream/Blocks", nil, stream) -} - func (s *Tier1Service) BlocksAny( ctx context.Context, request *pbsubstreamsrpc.Request, header http.Header, protocol string, pkg *pbsubstreams.Package, - stream *connect.ServerStream[pbsubstreamsrpc.Response], + stream grpc.ServerStream, ) (serverErr error) { - if s.IsTerminating() { serverErr = connect.NewError(connect.CodeUnavailable, errShuttingDown) return } + + supportedCompressors, e := grpc.ClientSupportedCompressors(stream.Context()) + if e != nil { + return fmt.Errorf("getting supported compressors: %w", e) + } + + fmt.Println("-----------------------------------------------") + fmt.Println("-----------------------------------------------") + fmt.Println("supported compressors:", supportedCompressors) + fmt.Println("-----------------------------------------------") + fmt.Println("-----------------------------------------------") + + compressionHeaderValue := "none" + switch { + case slices.Contains(supportedCompressors, "s2"): + compressionHeaderValue = "s2" + case slices.Contains(supportedCompressors, "gzip"): + compressionHeaderValue = "gzip" + case slices.Contains(supportedCompressors, "zstd"): + compressionHeaderValue = "zstd" + case slices.Contains(supportedCompressors, "lz4"): + compressionHeaderValue = "lz4" + } + e = stream.SetHeader(metadata.Pairs("grpc-encoding", compressionHeaderValue)) + if e != nil { + return fmt.Errorf("setting header: %w", e) + } + s.activeRequestsWG.Add(1) defer func() { if reason, countAsRejected := metrics.IsRejectedRequestError(serverErr); countAsRejected { @@ -1088,7 +1123,7 @@ func configureLiveBackFillerFromQuickload(ctx context.Context, segmentSize uint6 return nil } -func tier1ResponseHandler(ctx context.Context, mut *sync.Mutex, logger *zap.Logger, streamSrv *connect.ServerStream[pbsubstreamsrpc.Response], noop bool, stats *metrics.Stats, debugOutputForModules []string) substreams.ResponseFunc { +func tier1ResponseHandler(ctx context.Context, mut *sync.Mutex, logger *zap.Logger, streamSrv grpc.ServerStream, noop bool, stats *metrics.Stats, debugOutputForModules []string) substreams.ResponseFunc { auth := dauth.FromContext(ctx) organizationID := auth.OrganizationID() apiKeyID := auth.APIKeyID() @@ -1112,6 +1147,7 @@ func tier1ResponseHandler(ctx context.Context, mut *sync.Mutex, logger *zap.Logg } } + //var buffer []*pbsubstreamsrpc.BlockScopedData return func(respAny substreams.ResponseFromAnyTier) error { resp := respAny.(*pbsubstreamsrpc.Response) mut.Lock() @@ -1153,7 +1189,7 @@ func tier1ResponseHandler(ctx context.Context, mut *sync.Mutex, logger *zap.Logg egressBytes := proto.Size(resp) begin := time.Now() - if err := streamSrv.Send(resp); err != nil { + if err := streamSrv.SendMsg(resp); err != nil { logger.Info("unable to send block probably due to client disconnecting", zap.String("user_id", organizationID), zap.String("api_key_id", apiKeyID), zap.Error(err)) return connect.NewError(connect.CodeUnavailable, err) } diff --git a/sink/sinker.go b/sink/sinker.go index d1eef9661..79e4b11ee 100644 --- a/sink/sinker.go +++ b/sink/sinker.go @@ -28,6 +28,7 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/codes" + _ "google.golang.org/grpc/experimental" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/proto" ) From a17a4d2936c61433971884d8022ac152d9ea64f9 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 3 Feb 2026 13:13:19 -0500 Subject: [PATCH 02/47] _ "google.golang.org/grpc/experimental" --- client/client.go | 20 ++------------------ service/server.go | 1 + 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/client/client.go b/client/client.go index 41d23e2fd..f2f804515 100644 --- a/client/client.go +++ b/client/client.go @@ -11,8 +11,8 @@ import ( "time" "github.com/dustin/go-humanize" + "github.com/mostynb/go-grpc-compression/experimental/s2" _ "github.com/mostynb/go-grpc-compression/experimental/s2" - _ "github.com/mostynb/go-grpc-compression/lz4" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" "github.com/streamingfast/logging/zapx" @@ -25,7 +25,6 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/oauth" xdscreds "google.golang.org/grpc/credentials/xds" - "google.golang.org/grpc/encoding/gzip" _ "google.golang.org/grpc/encoding/gzip" stats "google.golang.org/grpc/stats" _ "google.golang.org/grpc/xds" @@ -426,22 +425,7 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close sizeHandler := &sizeLoggingHandler{} dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) - dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) - - //compressor := strings.ToLower(os.Getenv("GRPC_COMPRESSOR")) - //switch compressor { - //case "lz4": - // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(lz4.Name))) - //case "s2": - // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) - //case "zstd": - // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(zstd.Name))) - //case "gzip": - //case "none": - // dialOptions = append(dialOptions, grpc.WithCompressor(nil)) - //default: - // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) - //} + dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) dialOptions = append(dialOptions, grpc.WithUserAgent(config.agent)) diff --git a/service/server.go b/service/server.go index 5e2fc628e..01cbdebcf 100644 --- a/service/server.go +++ b/service/server.go @@ -19,6 +19,7 @@ import ( "go.opentelemetry.io/otel" "go.uber.org/zap" "google.golang.org/grpc" + _ "google.golang.org/grpc/experimental" ) func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck) []dgrpcserver.Option { From 9aa939c805fa107ec7be4496028f1d1784147994 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 3 Feb 2026 14:41:30 -0500 Subject: [PATCH 03/47] Setting stream response compressor Add support for dynamic gRPC compression selection based on environment settings --- client/client.go | 14 ++++++++++++-- service/tier1.go | 30 +++++++++++++++++++++--------- sink/sinker.go | 3 +++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/client/client.go b/client/client.go index f2f804515..c04492716 100644 --- a/client/client.go +++ b/client/client.go @@ -12,7 +12,10 @@ import ( "github.com/dustin/go-humanize" "github.com/mostynb/go-grpc-compression/experimental/s2" - _ "github.com/mostynb/go-grpc-compression/experimental/s2" + "google.golang.org/grpc/encoding/gzip" + + //"github.com/mostynb/go-grpc-compression/experimental/s2" + //_ "github.com/mostynb/go-grpc-compression/experimental/s2" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" "github.com/streamingfast/logging/zapx" @@ -425,7 +428,14 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close sizeHandler := &sizeLoggingHandler{} dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) - dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) + + compressor := os.Getenv("GRPC_COMPRESSOR") + switch compressor { + case "gzip": + dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) + case "s2": + dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) + } dialOptions = append(dialOptions, grpc.WithUserAgent(config.agent)) diff --git a/service/tier1.go b/service/tier1.go index 10f37f4f3..e7ce4f3ef 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -18,6 +18,9 @@ import ( "time" "connectrpc.com/connect" + "github.com/mostynb/go-grpc-compression/experimental/s2" + "github.com/mostynb/go-grpc-compression/lz4" + "github.com/mostynb/go-grpc-compression/zstd" "github.com/streamingfast/bstream" "github.com/streamingfast/bstream/hub" pbbstream "github.com/streamingfast/bstream/pb/sf/bstream/v1" @@ -58,6 +61,7 @@ import ( "go.uber.org/zap/zapcore" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/encoding/gzip" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" @@ -368,23 +372,31 @@ func (s *Tier1Service) BlocksAny( fmt.Println("-----------------------------------------------") fmt.Println("-----------------------------------------------") fmt.Println("supported compressors:", supportedCompressors) + fmt.Println("headers:", header) fmt.Println("-----------------------------------------------") fmt.Println("-----------------------------------------------") - compressionHeaderValue := "none" switch { case slices.Contains(supportedCompressors, "s2"): - compressionHeaderValue = "s2" + fmt.Println("Grrrrrr: Setting s2 compressor") + if e := grpc.SetSendCompressor(ctx, s2.Name); e != nil { + return fmt.Errorf("setting s2 compressor: %w", e) + } case slices.Contains(supportedCompressors, "gzip"): - compressionHeaderValue = "gzip" + fmt.Println("Grrrrrr: Setting gzip compressor") + if e := grpc.SetSendCompressor(ctx, gzip.Name); e != nil { + return fmt.Errorf("setting gzip compressor: %w", e) + } case slices.Contains(supportedCompressors, "zstd"): - compressionHeaderValue = "zstd" + fmt.Println("Grrrrrr: Setting zstd compressor") + if e := grpc.SetSendCompressor(ctx, zstd.Name); e != nil { + return fmt.Errorf("setting zstd compressor: %w", e) + } case slices.Contains(supportedCompressors, "lz4"): - compressionHeaderValue = "lz4" - } - e = stream.SetHeader(metadata.Pairs("grpc-encoding", compressionHeaderValue)) - if e != nil { - return fmt.Errorf("setting header: %w", e) + fmt.Println("Grrrrrr: Setting lz4 compressor") + if e := grpc.SetSendCompressor(ctx, lz4.Name); e != nil { + return fmt.Errorf("setting lz4 compressor: %w", e) + } } s.activeRequestsWG.Add(1) diff --git a/sink/sinker.go b/sink/sinker.go index 79e4b11ee..e17c39c28 100644 --- a/sink/sinker.go +++ b/sink/sinker.go @@ -482,6 +482,9 @@ func (s *Sinker) doRequest( s.Logger.Debug("launching substreams request", zap.Int64("start_block", req.StartBlockNum), zap.Stringer("cursor", activeCursor)) receivedDataMessage := false + //md := metadata.Pairs("grpc-accept-encoding", "s2,identity") + //ctx = metadata.NewOutgoingContext(ctx, md) + var stream grpc.ServerStreamingClient[pbsubstreamsrpc.Response] var err error From 371bf75dee19247ed071ac41c3cafad775f59639 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 3 Feb 2026 14:58:50 -0500 Subject: [PATCH 04/47] Refactor compressor selection to use a map-based lookup and remove `slices` dependency --- service/tier1.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/service/tier1.go b/service/tier1.go index e7ce4f3ef..d2640c84e 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -11,7 +11,6 @@ import ( "net/http" "os" "regexp" - "slices" "strconv" "strings" "sync" @@ -376,23 +375,25 @@ func (s *Tier1Service) BlocksAny( fmt.Println("-----------------------------------------------") fmt.Println("-----------------------------------------------") + compressors := compressorsFromHeader(header) + switch { - case slices.Contains(supportedCompressors, "s2"): + case compressors["s2"]: fmt.Println("Grrrrrr: Setting s2 compressor") if e := grpc.SetSendCompressor(ctx, s2.Name); e != nil { return fmt.Errorf("setting s2 compressor: %w", e) } - case slices.Contains(supportedCompressors, "gzip"): + case compressors["gzip"]: fmt.Println("Grrrrrr: Setting gzip compressor") if e := grpc.SetSendCompressor(ctx, gzip.Name); e != nil { return fmt.Errorf("setting gzip compressor: %w", e) } - case slices.Contains(supportedCompressors, "zstd"): + case compressors["zstd"]: fmt.Println("Grrrrrr: Setting zstd compressor") if e := grpc.SetSendCompressor(ctx, zstd.Name); e != nil { return fmt.Errorf("setting zstd compressor: %w", e) } - case slices.Contains(supportedCompressors, "lz4"): + case compressors["lz4"]: fmt.Println("Grrrrrr: Setting lz4 compressor") if e := grpc.SetSendCompressor(ctx, lz4.Name); e != nil { return fmt.Errorf("setting lz4 compressor: %w", e) @@ -659,6 +660,20 @@ func (s *Tier1Service) BlocksAny( return nil } +func compressorsFromHeader(header http.Header) (out map[string]bool) { + for k, v := range header { + petitK := strings.ToLower(k) + if petitK == "grpc-accept-encoding" || petitK == "connect-accept-encoding" || petitK == "accept-encoding" { + for _, vv := range v { + for _, vvv := range strings.Split(vv, ",") { + out[strings.ToLower(vvv)] = true + } + } + } + } + return +} + // writePackage writes the spkg to the module cache if it doesn't exist: // - `substreams.spkg.zst` if it comes from a substreams.rpc.v3 request (package is complete with metadata) // - `substreams.partial.spkg.zst` if it comes from a substreams.rpc.v2 request (package is partial, missing protobuf definitions and other metadata) From 948d746d8e1be791b6ae856b79556518d9310ed6 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 3 Feb 2026 15:03:58 -0500 Subject: [PATCH 05/47] Initialize `out` map in `compressorsFromHeader` function to prevent nil map errors. --- service/tier1.go | 1 + 1 file changed, 1 insertion(+) diff --git a/service/tier1.go b/service/tier1.go index d2640c84e..3b4721367 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -661,6 +661,7 @@ func (s *Tier1Service) BlocksAny( } func compressorsFromHeader(header http.Header) (out map[string]bool) { + out = make(map[string]bool) for k, v := range header { petitK := strings.ToLower(k) if petitK == "grpc-accept-encoding" || petitK == "connect-accept-encoding" || petitK == "accept-encoding" { From 21ae6b4cf7457204ac36278e5a304f135dc5f426 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 4 Feb 2026 13:45:24 -0500 Subject: [PATCH 06/47] Move compression management to grpc --- app/tier1.go | 2 +- client/client.go | 15 +++++---- go.mod | 9 +----- go.sum | 30 ++---------------- go.work.sum | 12 ++++++++ service/server.go | 13 ++++++-- service/tier1.go | 77 ++--------------------------------------------- 7 files changed, 35 insertions(+), 123 deletions(-) diff --git a/app/tier1.go b/app/tier1.go index e12ccae32..064db7bb6 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -303,7 +303,7 @@ func (a *Tier1App) Run() error { a.logger.Info("launching gRPC server", zap.Bool("live_support", withLive)) a.setIsReady(true) - err := service.ListenTier1(a.config.GRPCListenAddr, svc, infoServer, a.modules.Authenticator, a.logger, a.HealthCheck) + err := service.ListenTier1(a.config.GRPCListenAddr, svc, infoServer, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) a.Shutdown(err) }() diff --git a/client/client.go b/client/client.go index c04492716..af9cc6a1a 100644 --- a/client/client.go +++ b/client/client.go @@ -12,7 +12,6 @@ import ( "github.com/dustin/go-humanize" "github.com/mostynb/go-grpc-compression/experimental/s2" - "google.golang.org/grpc/encoding/gzip" //"github.com/mostynb/go-grpc-compression/experimental/s2" //_ "github.com/mostynb/go-grpc-compression/experimental/s2" @@ -429,13 +428,13 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close sizeHandler := &sizeLoggingHandler{} dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) - compressor := os.Getenv("GRPC_COMPRESSOR") - switch compressor { - case "gzip": - dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) - case "s2": - dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) - } + //compressor := os.Getenv("GRPC_COMPRESSOR") + //switch compressor { + //case "gzip": + // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) + //case "s2": + dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) + //}` dialOptions = append(dialOptions, grpc.WithUserAgent(config.agent)) diff --git a/go.mod b/go.mod index 42a79aa1d..8614a476c 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20251218142640-027692a12722 + github.com/streamingfast/dgrpc v0.0.0-20260204183929-a9686960eef3 github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 @@ -29,7 +29,6 @@ require ( require ( buf.build/gen/go/bufbuild/reflect/connectrpc/go v1.16.1-20240117202343-bf8f65e8876c.1 buf.build/gen/go/bufbuild/reflect/protocolbuffers/go v1.33.0-20240117202343-bf8f65e8876c.1 - buf.build/go/hyperpb v0.1.3 connectrpc.com/connect v1.19.1 github.com/KimMachineGun/automemlimit v0.7.5 github.com/RoaringBitmap/roaring v1.9.1 @@ -52,7 +51,6 @@ require ( github.com/google/uuid v1.6.0 github.com/hashicorp/go-multierror v1.1.1 github.com/itchyny/gojq v0.12.12 - github.com/klauspost/connect-compress/v2 v2.1.1 github.com/lithammer/dedent v1.1.0 github.com/mattn/go-isatty v0.0.20 github.com/mitchellh/go-testing-interface v1.14.1 @@ -94,9 +92,6 @@ require ( cel.dev/expr v0.24.0 // indirect cloud.google.com/go/auth v0.17.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect - connectrpc.com/grpchealth v1.3.0 // indirect - connectrpc.com/grpcreflect v1.3.0 // indirect - connectrpc.com/otelconnect v0.8.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect @@ -145,7 +140,6 @@ require ( github.com/iancoleman/strcase v0.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/manifoldco/promptui v0.9.0 // indirect - github.com/minio/minlz v1.0.1 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mschoch/smat v0.2.0 // indirect github.com/parquet-go/parquet-go v0.23.0 // indirect @@ -162,7 +156,6 @@ require ( github.com/streamingfast/validator v0.0.0-20231124184318-71ec8080e4ae // indirect github.com/thedevsaddam/govalidator v1.9.6 // indirect github.com/tidwall/match v1.1.1 // indirect - github.com/timandy/routine v1.1.5 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect diff --git a/go.sum b/go.sum index 8c568be49..0d4eb4b8a 100644 --- a/go.sum +++ b/go.sum @@ -1,15 +1,7 @@ -buf.build/gen/go/bufbuild/hyperpb-examples/protocolbuffers/go v1.36.7-20250725192734-0dd56aa9cbbc.1 h1:bFnppdLYActzr2F0iomSrkjUnGgVufb0DtZxjKgTLGc= -buf.build/gen/go/bufbuild/hyperpb-examples/protocolbuffers/go v1.36.7-20250725192734-0dd56aa9cbbc.1/go.mod h1:x7jYNX5/7EPnsKHEq596krkOGzvR97/MsZw2fw3Mrq0= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.7-20250717185734-6c6e0d3c608e.1 h1:/AZH8sVB6LHv8G+hZlAMCP31NevnesHwYgnlgS5Vt14= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.7-20250717185734-6c6e0d3c608e.1/go.mod h1:eva/VCrd8X7xuJw+JtwCEyrCKiRRASukFqmirnWBvFU= buf.build/gen/go/bufbuild/reflect/connectrpc/go v1.16.1-20240117202343-bf8f65e8876c.1 h1:UITHLAtIrN0+SNbpYlNs3ca/Xme048ecetS6DD3t6E8= buf.build/gen/go/bufbuild/reflect/connectrpc/go v1.16.1-20240117202343-bf8f65e8876c.1/go.mod h1:8aC0AUYVzAH5wP6/43Z89/0un0nvZyf+PVSeeaHyYyg= buf.build/gen/go/bufbuild/reflect/protocolbuffers/go v1.33.0-20240117202343-bf8f65e8876c.1 h1:9ROfgUJtdplIn+2PvUB+Z7HMRVBIsU0uCPAcPfes98I= buf.build/gen/go/bufbuild/reflect/protocolbuffers/go v1.33.0-20240117202343-bf8f65e8876c.1/go.mod h1:TF9ggHlVzYnMjBa4v+ghV6daBmQ0AU4KaAMezoCmX9c= -buf.build/go/hyperpb v0.1.3 h1:wiw2F7POvAe2VA2kkB0TAsFwj91lXbFrKM41D3ZgU1w= -buf.build/go/hyperpb v0.1.3/go.mod h1:IHXAM5qnS0/Fsnd7/HGDghFNvUET646WoHmq1FDZXIE= -buf.build/go/protovalidate v0.14.0 h1:kr/rC/no+DtRyYX+8KXLDxNnI1rINz0imk5K44ZpZ3A= -buf.build/go/protovalidate v0.14.0/go.mod h1:+F/oISho9MO7gJQNYC2VWLzcO1fTPmaTA08SDYJZncA= cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -72,12 +64,6 @@ cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4 cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI= connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14= connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= -connectrpc.com/grpchealth v1.3.0 h1:FA3OIwAvuMokQIXQrY5LbIy8IenftksTP/lG4PbYN+E= -connectrpc.com/grpchealth v1.3.0/go.mod h1:3vpqmX25/ir0gVgW6RdnCPPZRcR6HvqtXX5RNPmDXHM= -connectrpc.com/grpcreflect v1.3.0 h1:Y4V+ACf8/vOb1XOc251Qun7jMB75gCUNw6llvB9csXc= -connectrpc.com/grpcreflect v1.3.0/go.mod h1:nfloOtCS8VUQOQ1+GTdFzVg2CJo4ZGaat8JIovCtDYs= -connectrpc.com/otelconnect v0.8.0 h1:a4qrN4H8aEE2jAoCxheZYYfEjXMgVPyL9OzPQLBEFXU= -connectrpc.com/otelconnect v0.8.0/go.mod h1:AEkVLjCPXra+ObGFCOClcJkNjS7zPaQSqvO0lCyjfZc= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc= @@ -132,8 +118,6 @@ github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= -github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= -github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -327,8 +311,6 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI= -github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -419,8 +401,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw= github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= -github.com/klauspost/connect-compress/v2 v2.1.1 h1:ycZNp4rWOZBodVE2Ls5AzK4aHkyK+GteEfzRZgKNs+c= -github.com/klauspost/connect-compress/v2 v2.1.1/go.mod h1:9oilsPHJMzGKkjafSBk9J7iVo4mO+dw0G0KSdVpnlVE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -461,8 +441,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= -github.com/minio/minlz v1.0.1 h1:OUZUzXcib8diiX+JYxyRLIdomyZYzHct6EShOKtQY2A= -github.com/minio/minlz v1.0.1/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= @@ -561,8 +539,6 @@ github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= -github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs= -github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe h1:zMPExWZl9RstP9jCVEIUp4DxQoW2Co/8Apsqb+Muntg= github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe/go.mod h1:0sed+gw+d62tBsGl5omaB1m14Gmfvb3YAs4epHuL1YU= github.com/streamingfast/cli v0.0.4-0.20250815192146-d8a233ec3d0b h1:ztYeX3/5rg2tV2EU7edcrcHzMz6wUbdJB+LqCrP5W8s= @@ -573,8 +549,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20251218142640-027692a12722 h1:gZcPR64H5aWs49bLDoNTjhsedTfva7fAIei891LL0C8= -github.com/streamingfast/dgrpc v0.0.0-20251218142640-027692a12722/go.mod h1:NbkvenEHfjQpUBRHTCp/tp0Ayjp5hDzzkv/Ve9Uka1I= +github.com/streamingfast/dgrpc v0.0.0-20260204183929-a9686960eef3 h1:6c4ha0hy8t2cAMF3OSLrkM+c9T5nAlewL2T4PNRscN8= +github.com/streamingfast/dgrpc v0.0.0-20260204183929-a9686960eef3/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= @@ -649,8 +625,6 @@ github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/timandy/routine v1.1.5 h1:LSpm7Iijwb9imIPlucl4krpr2EeCeAUvifiQ9Uf5X+M= -github.com/timandy/routine v1.1.5/go.mod h1:kXslgIosdY8LW0byTyPnenDgn4/azt2euufAq9rK51w= github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9/go.mod h1:q+QjxYvZ+fpjMXqs+XEriussHjSYqeXVnAdSV1tkMYk= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/go.work.sum b/go.work.sum index cd372f32f..2e5bbf158 100644 --- a/go.work.sum +++ b/go.work.sum @@ -432,14 +432,21 @@ contrib.go.opencensus.io/exporter/zipkin v0.1.1/go.mod h1:GMvdSl3eJ2gapOaLKzTKE3 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= git.sr.ht/~sbinet/gg v0.6.0 h1:RIzgkizAk+9r7uPzf/VfbJHBMKUr0F5hRFxTUGMnt38= git.sr.ht/~sbinet/gg v0.6.0/go.mod h1:uucygbfC9wVPQIfrmwM2et0imr8L7KQWywX0xpFMm94= +github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U= github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= +github.com/Azure/azure-storage-blob-go v0.14.0 h1:1BCg74AmVdYwO3dlKwtFU1V0wU2PZdREkXvAmZJRUlM= github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= @@ -502,6 +509,7 @@ github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+ github.com/aws/aws-sdk-go v1.25.43/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.233/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM= github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg= @@ -607,6 +615,7 @@ github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZ github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= @@ -790,7 +799,9 @@ github.com/jhump/gopoet v0.1.0 h1:gYjOPnzHd2nzB37xYQZxj4EIQNpBrBskRqQQ3q4ZgSg= github.com/jhump/goprotoc v0.5.0 h1:Y1UgUX+txUznfqcGdDef8ZOVlyQvnV0pKWZH08RmZuo= github.com/jimsmart/schema v0.2.0 h1:CZw+580ED3lkh5XR3JxFN/ZxPq8BdCVwlgAjnRlPkvM= github.com/jimsmart/schema v0.2.0/go.mod h1:v457lgfQ/WPwEWCnetnCNXLYXGDKHceLIWVENhq89rA= +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= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/josephburnett/jd v1.7.1/go.mod h1:R8ZnZnLt2D4rhW4NvBc/USTo6mzyNT6fYNIIWOJA9GY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= @@ -846,6 +857,7 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI= github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/melbahja/goph v1.4.0 h1:z0PgDbBFe66lRYl3v5dGb9aFgPy0kotuQ37QOwSQFqs= diff --git a/service/server.go b/service/server.go index 01cbdebcf..a09e5a634 100644 --- a/service/server.go +++ b/service/server.go @@ -22,9 +22,10 @@ import ( _ "google.golang.org/grpc/experimental" ) -func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck) []dgrpcserver.Option { +func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { tracerProvider := otel.GetTracerProvider() options := []dgrpcserver.Option{ + dgrpcserver.WithLogger(logger), dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), dgrpcserver.WithGRPCServerOptions( @@ -32,6 +33,10 @@ func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck d grpc.MaxRecvMsgSize(1024*1024*1024), ), } + if enforceCompression { + options = append(options, dgrpcserver.WithEnforceCompression()) + } + if strings.Contains(listenAddr, "*") { options = append(options, dgrpcserver.WithInsecureServer()) } else { @@ -55,6 +60,7 @@ func ListenTier1( auth dauth.Authenticator, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, + enforceCompression bool, ) (err error) { done := make(chan any) @@ -62,7 +68,7 @@ func ListenTier1( var servers []dgrpcserver.Server for _, addr := range strings.Split(listenAddr, ",") { // note: some of these common options don't work with connectWeb - options := GetCommonServerOptions(addr, logger, healthcheck) + options := GetCommonServerOptions(addr, logger, healthcheck, enforceCompression) options = append(options, dgrpcserver.WithPostUnaryInterceptor(dauthgrpc.UnaryAuthChecker(auth, logger))) options = append(options, dgrpcserver.WithPostStreamInterceptor(dauthgrpc.StreamAuthChecker(auth, logger))) grpcServer := factory.ServerFromOptions(options...) @@ -110,8 +116,9 @@ func ListenTier2( auth dauth.Authenticator, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, + enforceCompression bool, ) (err error) { - options := GetCommonServerOptions(addr, logger, healthcheck) + options := GetCommonServerOptions(addr, logger, healthcheck, enforceCompression) if serviceDiscoveryURL != nil { options = append(options, dgrpcserver.WithServiceDiscoveryURL(serviceDiscoveryURL)) } diff --git a/service/tier1.go b/service/tier1.go index 3b4721367..42d6db5f0 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -17,9 +17,6 @@ import ( "time" "connectrpc.com/connect" - "github.com/mostynb/go-grpc-compression/experimental/s2" - "github.com/mostynb/go-grpc-compression/lz4" - "github.com/mostynb/go-grpc-compression/zstd" "github.com/streamingfast/bstream" "github.com/streamingfast/bstream/hub" pbbstream "github.com/streamingfast/bstream/pb/sf/bstream/v1" @@ -60,7 +57,6 @@ import ( "go.uber.org/zap/zapcore" "google.golang.org/grpc" "google.golang.org/grpc/codes" - "google.golang.org/grpc/encoding/gzip" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" @@ -363,43 +359,6 @@ func (s *Tier1Service) BlocksAny( return } - supportedCompressors, e := grpc.ClientSupportedCompressors(stream.Context()) - if e != nil { - return fmt.Errorf("getting supported compressors: %w", e) - } - - fmt.Println("-----------------------------------------------") - fmt.Println("-----------------------------------------------") - fmt.Println("supported compressors:", supportedCompressors) - fmt.Println("headers:", header) - fmt.Println("-----------------------------------------------") - fmt.Println("-----------------------------------------------") - - compressors := compressorsFromHeader(header) - - switch { - case compressors["s2"]: - fmt.Println("Grrrrrr: Setting s2 compressor") - if e := grpc.SetSendCompressor(ctx, s2.Name); e != nil { - return fmt.Errorf("setting s2 compressor: %w", e) - } - case compressors["gzip"]: - fmt.Println("Grrrrrr: Setting gzip compressor") - if e := grpc.SetSendCompressor(ctx, gzip.Name); e != nil { - return fmt.Errorf("setting gzip compressor: %w", e) - } - case compressors["zstd"]: - fmt.Println("Grrrrrr: Setting zstd compressor") - if e := grpc.SetSendCompressor(ctx, zstd.Name); e != nil { - return fmt.Errorf("setting zstd compressor: %w", e) - } - case compressors["lz4"]: - fmt.Println("Grrrrrr: Setting lz4 compressor") - if e := grpc.SetSendCompressor(ctx, lz4.Name); e != nil { - return fmt.Errorf("setting lz4 compressor: %w", e) - } - } - s.activeRequestsWG.Add(1) defer func() { if reason, countAsRejected := metrics.IsRejectedRequestError(serverErr); countAsRejected { @@ -446,10 +405,7 @@ func (s *Tier1Service) BlocksAny( ctx, span := reqctx.WithSpan(ctx, "substreams/tier1/request") defer span.EndWithErr(&err) - var compressed bool - if matchHeader(header) { - compressed = true - } + compressor := header.Values("grpc-encoding") fields := []zap.Field{ zap.String("protocol", protocol), @@ -457,7 +413,7 @@ func (s *Tier1Service) BlocksAny( zap.Uint64("stop_block", request.StopBlockNum), zap.String("cursor", request.StartCursor), zap.String("output_module", request.OutputModule), - zap.Bool("compressed", compressed), + zap.Strings("compressor", compressor), zap.Bool("final_blocks_only", request.FinalBlocksOnly), zap.Bool("production_mode", request.ProductionMode), zap.Bool("noop_mode", request.NoopMode), @@ -465,13 +421,6 @@ func (s *Tier1Service) BlocksAny( zap.Bool("partial_blocks", request.PartialBlocks), } - if s.enforceCompression && !compressed { - err := connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("your client does not accept gzip- or zstd-compressed streams. Check how to enable it on your gRPC or ConnectRPC client")) - fields = append(fields, zap.Error(err)) - logger.Info("refusing Substreams Blocks request", fields...) - return err - } - if request.Modules == nil { err := connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("missing modules in request")) fields = append(fields, zap.Error(err)) @@ -1424,28 +1373,6 @@ func toConnectError(ctx context.Context, err error) error { return connect.NewError(connect.CodeInternal, err) } -// must be lowercase -var compressionHeader = map[string]map[string]bool{ - "grpc-accept-encoding": {"gzip": true, "zstd": true}, - "connect-accept-encoding": {"gzip": true, "zstd": true}, - "accept-encoding": {"gzip": true}, // HTTP encoding for connect+proto in browser -} - -func matchHeader(header http.Header) bool { - for k, v := range header { - if validEncodings, ok := compressionHeader[strings.ToLower(k)]; ok { - for _, vv := range v { - for _, vvv := range strings.Split(vv, ",") { - if validEncodings[strings.TrimSpace(strings.ToLower(vvv))] { - return true - } - } - } - } - } - return false -} - type overloadingStatus struct { // set only if either soft or hard limit set is > 0 activeRequestCount int From e9661c33540245ce6eef8db1eb7bdf08b359376e Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 4 Feb 2026 13:51:58 -0500 Subject: [PATCH 07/47] Pass `false` parameter to `ListenTier2` call to disable default behavior. --- app/tier2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/tier2.go b/app/tier2.go index 1ad734ca7..f2e7dcb2b 100644 --- a/app/tier2.go +++ b/app/tier2.go @@ -124,7 +124,7 @@ func (a *Tier2App) Run() error { a.logger.Info("launching gRPC server") a.setIsReady(true) - err := service.ListenTier2(a.config.GRPCListenAddr, a.config.ServiceDiscoveryURL, svc, trustAuth, a.logger, a.HealthCheck) + err := service.ListenTier2(a.config.GRPCListenAddr, a.config.ServiceDiscoveryURL, svc, trustAuth, a.logger, a.HealthCheck, false) a.Shutdown(err) }() From 9dd1d4e2e97f73eb2722cf7e670faa9685e75dcd Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 4 Feb 2026 16:02:38 -0500 Subject: [PATCH 08/47] Log error when Substreams client initialization fails and update handling of gRPC compression settings. --- client/client.go | 7 +++++-- service/tier1.go | 3 --- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/client.go b/client/client.go index af9cc6a1a..a3ed705ef 100644 --- a/client/client.go +++ b/client/client.go @@ -313,6 +313,9 @@ func NewInternalClientFactory(config *SubstreamsClientConfig) InternalClientFact noop := func() error { return nil } cli, _, callOpts, headers, err := NewSubstreamsInternalClient(config) + if err != nil { + zlog.Error("failed to create substreams client", zap.Error(err)) + } return func() (pbssinternal.SubstreamsClient, func() error, []grpc.CallOption, Headers, error) { return cli, noop, callOpts, headers, err } @@ -431,10 +434,10 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close //compressor := os.Getenv("GRPC_COMPRESSOR") //switch compressor { //case "gzip": - // dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) + //dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) //case "s2": dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) - //}` + //} dialOptions = append(dialOptions, grpc.WithUserAgent(config.agent)) diff --git a/service/tier1.go b/service/tier1.go index 42d6db5f0..c2624fb79 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -405,15 +405,12 @@ func (s *Tier1Service) BlocksAny( ctx, span := reqctx.WithSpan(ctx, "substreams/tier1/request") defer span.EndWithErr(&err) - compressor := header.Values("grpc-encoding") - fields := []zap.Field{ zap.String("protocol", protocol), zap.Int64("start_block", request.StartBlockNum), zap.Uint64("stop_block", request.StopBlockNum), zap.String("cursor", request.StartCursor), zap.String("output_module", request.OutputModule), - zap.Strings("compressor", compressor), zap.Bool("final_blocks_only", request.FinalBlocksOnly), zap.Bool("production_mode", request.ProductionMode), zap.Bool("noop_mode", request.NoopMode), From e49b276507c2087de3d86b67801957bb76b2ff19 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 10:49:51 -0500 Subject: [PATCH 09/47] Parallel support of grpc and connect servers --- app/tier1.go | 44 ++- buf.gen.yaml | 9 + client/client.go | 12 +- go.mod | 8 +- go.sum | 8 +- orchestrator/execout/execout_walker.go | 21 +- orchestrator/execout/message_buffer.go | 64 ++++ orchestrator/response/stream.go | 4 + .../conversation/v1/conversation_grpc.pb.go | 8 +- pb/sf/substreams/intern/v2/service_grpc.pb.go | 6 +- pb/sf/substreams/rpc/v2/service.pb.go | 294 ++++++++++------ pb/sf/substreams/rpc/v2/service_grpc.pb.go | 10 +- pb/sf/substreams/rpc/v3/service_grpc.pb.go | 6 +- .../sink/service/v1/service_grpc.pb.go | 20 +- proto/sf/substreams/rpc/v2/service.proto | 5 + service/server.go | 330 +++++++++++++++--- service/tier1.go | 10 +- sink/sinker.go | 159 +++++---- types.go | 5 + 19 files changed, 750 insertions(+), 273 deletions(-) create mode 100644 orchestrator/execout/message_buffer.go diff --git a/app/tier1.go b/app/tier1.go index 064db7bb6..5a38fcf5c 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -6,6 +6,7 @@ import ( "fmt" "net/url" "os" + "strings" "time" "github.com/streamingfast/bstream" @@ -23,6 +24,7 @@ import ( pbsubstreamsrpcv2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" "github.com/streamingfast/substreams/reqctx" "github.com/streamingfast/substreams/service" + "github.com/streamingfast/substreams/service/connect" "github.com/streamingfast/substreams/wasm" _ "github.com/streamingfast/substreams/wasm/wasmtime" @@ -247,7 +249,7 @@ func (a *Tier1App) Run() error { FoundationalStoreEndpoints: foundationalStoreEndpoints, } - svc, err := service.NewTier1( + tier1Service, err := service.NewTier1( a.logger, mergedBlocksStore, forkedBlocksStore, @@ -273,10 +275,12 @@ func (a *Tier1App) Run() error { return err } + tier1ServiceConnect := connect.NewService(tier1Service) + a.OnTerminating(func(err error) { metrics.AppReadinessTier1.SetNotReady() - svc.Shutdown(err) + tier1Service.Shutdown(err) }) go func() { @@ -303,7 +307,41 @@ func (a *Tier1App) Run() error { a.logger.Info("launching gRPC server", zap.Bool("live_support", withLive)) a.setIsReady(true) - err := service.ListenTier1(a.config.GRPCListenAddr, svc, infoServer, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) + secureGrpcProxyAddr := ":9000" + plaintextGrpcProxyAddr := ":8080" + + secureGrpcAddr := ":9100" + plaintextGrpcAddr := ":8180" + + secureConnectProxyAddr := ":9200" + plaintextConnectProxyAddr := ":8180" + + addresses := strings.Split(a.config.GRPCListenAddr, ",") + addressCount := len(addresses) + if addressCount == 0 { + a.logger.Error("no gRPC listen addresses provided") + return + } + if addressCount > 0 { + secureGrpcProxyAddr = addresses[0] + } + if addressCount > 1 { + plaintextGrpcProxyAddr = addresses[1] + } + if addressCount > 2 { + secureGrpcAddr = addresses[2] + } + if addressCount > 3 { + plaintextGrpcAddr = addresses[3] + } + if addressCount > 4 { + secureConnectProxyAddr = addresses[4] + } + if addressCount > 5 { + plaintextConnectProxyAddr = addresses[5] + } + + err := service.ListenTier1(secureGrpcProxyAddr, plaintextGrpcProxyAddr, secureGrpcAddr, plaintextGrpcAddr, secureConnectProxyAddr, plaintextConnectProxyAddr, tier1Service, tier1ServiceConnect, infoServer, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) a.Shutdown(err) }() diff --git a/buf.gen.yaml b/buf.gen.yaml index b9445963e..298213374 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -19,6 +19,15 @@ plugins: - Msf/substreams/foundational-store/model/v2/model.proto=github.com/streamingfast/substreams/pb/sf/substreams/foundational-store/model/v2;pbmodel - Msf/substreams/foundational-store/service/v2/service.proto=github.com/streamingfast/substreams/pb/sf/substreams/foundational-store/service/v2;pbservice - Msf/substreams/foundational-store/service/v1/service.proto=github.com/streamingfast/substreams/pb/sf/substreams/foundational-store/service/v1;pbstore + - remote: buf.build/community/planetscale-vtprotobuf:v0.6.0 + out: pb + opt: + - paths=source_relative + - features=marshal+unmarshal+size+equal+clone + - Msf/codegen/conversation/v1/conversation.proto=github.com/streamingfast/substreams/pb/sf/codegen/conversation/v1;pbconvo + - Msf/substreams/foundational-store/model/v2/model.proto=github.com/streamingfast/substreams/pb/sf/substreams/foundational-store/model/v2;pbmodel + - Msf/substreams/foundational-store/service/v2/service.proto=github.com/streamingfast/substreams/pb/sf/substreams/foundational-store/service/v2;pbservice + - Msf/substreams/foundational-store/service/v1/service.proto=github.com/streamingfast/substreams/pb/sf/substreams/foundational-store/service/v1;pbstore - remote: buf.build/connectrpc/go:v1.15.0 out: pb opt: diff --git a/client/client.go b/client/client.go index a3ed705ef..9c3bbdddc 100644 --- a/client/client.go +++ b/client/client.go @@ -12,9 +12,7 @@ import ( "github.com/dustin/go-humanize" "github.com/mostynb/go-grpc-compression/experimental/s2" - - //"github.com/mostynb/go-grpc-compression/experimental/s2" - //_ "github.com/mostynb/go-grpc-compression/experimental/s2" + vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" "github.com/streamingfast/logging/zapx" @@ -27,11 +25,17 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/oauth" xdscreds "google.golang.org/grpc/credentials/xds" + "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/encoding/gzip" stats "google.golang.org/grpc/stats" _ "google.golang.org/grpc/xds" ) +func init() { + fmt.Println("------------------ VT Proto registered ------------------------") + encoding.RegisterCodec(vt.Codec{}) +} + type AuthType int const ( @@ -187,6 +191,7 @@ func (h *sizeLoggingHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) } func (h *sizeLoggingHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { + //fmt.Println("handle rpc:", h.messageCount) if inPayload, ok := rs.(*stats.InPayload); ok && inPayload != nil { if h.messageCount == 0 { h.timeStart = time.Now() @@ -213,6 +218,7 @@ func (h *sizeLoggingHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { zap.String("compressed", humanize.Bytes(uint64(h.compressedBytes))), zap.Int("uncompressed_bytes", h.uncompressedBytes), zap.Int("compressed_bytes", h.compressedBytes), + zap.Bool("keep", false), ) h.timeStart = time.Now() diff --git a/go.mod b/go.mod index 8614a476c..95920b906 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,10 @@ go 1.25.0 toolchain go1.25.4 +//replace ( +// github.com/streamingfast/dgrpc => ../dgrpc +//) + require ( github.com/golang/protobuf v1.5.4 github.com/jhump/protoreflect v1.14.0 @@ -14,7 +18,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260204183929-a9686960eef3 + github.com/streamingfast/dgrpc v0.0.0-20260206130010-7b182ca29e1d github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 @@ -51,6 +55,7 @@ require ( github.com/google/uuid v1.6.0 github.com/hashicorp/go-multierror v1.1.1 github.com/itchyny/gojq v0.12.12 + github.com/klauspost/connect-compress/v2 v2.1.1 github.com/lithammer/dedent v1.1.0 github.com/mattn/go-isatty v0.0.20 github.com/mitchellh/go-testing-interface v1.14.1 @@ -140,6 +145,7 @@ require ( github.com/iancoleman/strcase v0.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/manifoldco/promptui v0.9.0 // indirect + github.com/minio/minlz v1.0.1 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mschoch/smat v0.2.0 // indirect github.com/parquet-go/parquet-go v0.23.0 // indirect diff --git a/go.sum b/go.sum index 0d4eb4b8a..4a170ff5c 100644 --- a/go.sum +++ b/go.sum @@ -401,6 +401,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw= github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/connect-compress/v2 v2.1.1 h1:ycZNp4rWOZBodVE2Ls5AzK4aHkyK+GteEfzRZgKNs+c= +github.com/klauspost/connect-compress/v2 v2.1.1/go.mod h1:9oilsPHJMzGKkjafSBk9J7iVo4mO+dw0G0KSdVpnlVE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -441,6 +443,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= +github.com/minio/minlz v1.0.1 h1:OUZUzXcib8diiX+JYxyRLIdomyZYzHct6EShOKtQY2A= +github.com/minio/minlz v1.0.1/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= @@ -549,8 +553,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20260204183929-a9686960eef3 h1:6c4ha0hy8t2cAMF3OSLrkM+c9T5nAlewL2T4PNRscN8= -github.com/streamingfast/dgrpc v0.0.0-20260204183929-a9686960eef3/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= +github.com/streamingfast/dgrpc v0.0.0-20260206130010-7b182ca29e1d h1:of9deUKR0hED+nqdEtL0S9bQsZ65+qJ1QN0U4l9/8kc= +github.com/streamingfast/dgrpc v0.0.0-20260206130010-7b182ca29e1d/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= diff --git a/orchestrator/execout/execout_walker.go b/orchestrator/execout/execout_walker.go index d32e330f9..b5e328ce8 100644 --- a/orchestrator/execout/execout_walker.go +++ b/orchestrator/execout/execout_walker.go @@ -10,9 +10,6 @@ import ( "github.com/streamingfast/bstream" "github.com/streamingfast/dstore" - "go.uber.org/zap" - "google.golang.org/protobuf/types/known/anypb" - "github.com/streamingfast/substreams/block" "github.com/streamingfast/substreams/orchestrator/loop" "github.com/streamingfast/substreams/orchestrator/response" @@ -21,6 +18,8 @@ import ( "github.com/streamingfast/substreams/reqctx" "github.com/streamingfast/substreams/storage/execout" pboutput "github.com/streamingfast/substreams/storage/execout/pb" + "go.uber.org/zap" + "google.golang.org/protobuf/types/known/anypb" ) type Walker struct { @@ -33,6 +32,7 @@ type Walker struct { working bool workingAt time.Time // Timestamp when working was set to true noopMode bool + buffer *MessageBuffer } func NewWalker( @@ -52,6 +52,7 @@ func NewWalker( streamOut: stream, noopMode: noopMode, logger: logger, + buffer: NewMessageBuffer(100), } } @@ -167,6 +168,7 @@ func (r *Walker) CmdDownloadCurrentSegment(waitBefore time.Duration) loop.Cmd { zap.Int("segment", current), zap.Error(err), ) + return loop.NewQuitMsg(err) } } @@ -226,6 +228,12 @@ func (r *Walker) sendItems(reader execout.FileReader) error { itemCount := 0 for item, err := range reader.Iter() { if err != nil { + if err == io.EOF { + err := r.buffer.Flush(r.streamOut) + if err != nil { + return fmt.Errorf("flushing buffer on eof: %w", err) + } + } return err } if item.BlockNum < r.StartBlock { @@ -245,6 +253,13 @@ func (r *Walker) sendItems(reader execout.FileReader) error { return fmt.Errorf("converting to block scoped data: %w", err) } + r.buffer.Append(blockScopedData) + if r.buffer.ShouldFlush() { + err := r.buffer.Flush(r.streamOut) + if err != nil { + return fmt.Errorf("flushing buffer: %w", err) + } + } if err = r.streamOut.BlockScopedData(blockScopedData); err != nil { return fmt.Errorf("calling response func: %w", err) } diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go new file mode 100644 index 000000000..b016a2d66 --- /dev/null +++ b/orchestrator/execout/message_buffer.go @@ -0,0 +1,64 @@ +package execout + +import ( + "fmt" + "sync" + "time" + + "github.com/streamingfast/substreams/orchestrator/response" + pbsubstreamsrpcv2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" +) + +type MessageBuffer struct { + mut sync.RWMutex + buf *pbsubstreamsrpcv2.BlockScopedDatas + lastFlush time.Time + maxBufferedMessage int +} + +func NewMessageBuffer(maxBufferedMessage int) *MessageBuffer { + return &MessageBuffer{ + buf: &pbsubstreamsrpcv2.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}}, + maxBufferedMessage: maxBufferedMessage, + } +} + +func (b *MessageBuffer) Len() int { + b.mut.Lock() + defer b.mut.Unlock() + + return len(b.buf.Items) +} + +func (b *MessageBuffer) Append(msg *pbsubstreamsrpcv2.BlockScopedData) { + b.mut.Lock() + defer b.mut.Unlock() + + b.buf.Items = append(b.buf.Items, msg) +} + +func (b *MessageBuffer) ShouldFlush() bool { + b.mut.Lock() + defer b.mut.Unlock() + + if b.Len() > b.maxBufferedMessage { + return true + } + + return false +} + +func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { + b.mut.Lock() + defer b.mut.Unlock() + + err := streamSrv.BlockScopedDatas(b.buf) + if err != nil { + return fmt.Errorf("flushing buffer: %w", err) + } + + b.lastFlush = time.Now() + b.buf = &pbsubstreamsrpcv2.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}} + + return nil +} diff --git a/orchestrator/response/stream.go b/orchestrator/response/stream.go index 7800a7c98..187b18e46 100644 --- a/orchestrator/response/stream.go +++ b/orchestrator/response/stream.go @@ -19,6 +19,10 @@ func (s *Stream) BlockScopedData(in *pbsubstreamsrpc.BlockScopedData) error { return s.respFunc(substreams.NewBlockScopedDataResponse(in)) } +func (s *Stream) BlockScopedDatas(in *pbsubstreamsrpc.BlockScopedDatas) error { + return s.respFunc(substreams.NewBlockScopedDatasResponse(in)) +} + func (s *Stream) SendModulesStats(stats []*pbsubstreamsrpc.ModuleStats, stages []*pbsubstreamsrpc.Stage, jobs []*pbsubstreamsrpc.Job, bytesRead, bytesWritten, blocksProcessed uint64) error { return s.respFunc(&pbsubstreamsrpc.Response{ Message: &pbsubstreamsrpc.Response_Progress{ diff --git a/pb/sf/codegen/conversation/v1/conversation_grpc.pb.go b/pb/sf/codegen/conversation/v1/conversation_grpc.pb.go index c32558e36..91cf95a6e 100644 --- a/pb/sf/codegen/conversation/v1/conversation_grpc.pb.go +++ b/pb/sf/codegen/conversation/v1/conversation_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.6.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: sf/codegen/conversation/v1/conversation.proto @@ -78,10 +78,10 @@ type ConversationServiceServer interface { type UnimplementedConversationServiceServer struct{} func (UnimplementedConversationServiceServer) Converse(grpc.BidiStreamingServer[UserInput, SystemOutput]) error { - return status.Error(codes.Unimplemented, "method Converse not implemented") + return status.Errorf(codes.Unimplemented, "method Converse not implemented") } func (UnimplementedConversationServiceServer) Discover(context.Context, *DiscoveryRequest) (*DiscoveryResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Discover not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Discover not implemented") } func (UnimplementedConversationServiceServer) testEmbeddedByValue() {} @@ -93,7 +93,7 @@ type UnsafeConversationServiceServer interface { } func RegisterConversationServiceServer(s grpc.ServiceRegistrar, srv ConversationServiceServer) { - // If the following call panics, it indicates UnimplementedConversationServiceServer was + // If the following call pancis, it indicates UnimplementedConversationServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pb/sf/substreams/intern/v2/service_grpc.pb.go b/pb/sf/substreams/intern/v2/service_grpc.pb.go index 4c7f366a8..3557010df 100644 --- a/pb/sf/substreams/intern/v2/service_grpc.pb.go +++ b/pb/sf/substreams/intern/v2/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.6.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: sf/substreams/intern/v2/service.proto @@ -71,7 +71,7 @@ type SubstreamsServer interface { type UnimplementedSubstreamsServer struct{} func (UnimplementedSubstreamsServer) ProcessRange(*ProcessRangeRequest, grpc.ServerStreamingServer[ProcessRangeResponse]) error { - return status.Error(codes.Unimplemented, "method ProcessRange not implemented") + return status.Errorf(codes.Unimplemented, "method ProcessRange not implemented") } func (UnimplementedSubstreamsServer) testEmbeddedByValue() {} @@ -83,7 +83,7 @@ type UnsafeSubstreamsServer interface { } func RegisterSubstreamsServer(s grpc.ServiceRegistrar, srv SubstreamsServer) { - // If the following call panics, it indicates UnimplementedSubstreamsServer was + // If the following call pancis, it indicates UnimplementedSubstreamsServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pb/sf/substreams/rpc/v2/service.pb.go b/pb/sf/substreams/rpc/v2/service.pb.go index 7ea3f3d48..6412a8bde 100644 --- a/pb/sf/substreams/rpc/v2/service.pb.go +++ b/pb/sf/substreams/rpc/v2/service.pb.go @@ -7,15 +7,14 @@ package pbsubstreamsrpcv2 import ( - reflect "reflect" - sync "sync" - unsafe "unsafe" - v2 "github.com/streamingfast/pbgo/sf/firehose/v2" v1 "github.com/streamingfast/substreams/pb/sf/substreams/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) const ( @@ -74,7 +73,7 @@ func (x StoreDelta_Operation) Number() protoreflect.EnumNumber { // Deprecated: Use StoreDelta_Operation.Descriptor instead. func (StoreDelta_Operation) EnumDescriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{17, 0} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{18, 0} } type Request struct { @@ -258,6 +257,7 @@ type Response struct { // *Response_BlockScopedData // *Response_BlockUndoSignal // *Response_FatalError + // *Response_BlockScopedDatas // *Response_DebugSnapshotData // *Response_DebugSnapshotComplete Message isResponse_Message `protobuf_oneof:"message"` @@ -347,6 +347,15 @@ func (x *Response) GetFatalError() *Error { return nil } +func (x *Response) GetBlockScopedDatas() *BlockScopedDatas { + if x != nil { + if x, ok := x.Message.(*Response_BlockScopedDatas); ok { + return x.BlockScopedDatas + } + } + return nil +} + func (x *Response) GetDebugSnapshotData() *InitialSnapshotData { if x != nil { if x, ok := x.Message.(*Response_DebugSnapshotData); ok { @@ -389,6 +398,10 @@ type Response_FatalError struct { FatalError *Error `protobuf:"bytes,5,opt,name=fatal_error,json=fatalError,proto3,oneof"` } +type Response_BlockScopedDatas struct { + BlockScopedDatas *BlockScopedDatas `protobuf:"bytes,6,opt,name=block_scoped_datas,json=blockScopedDatas,proto3,oneof"` +} + type Response_DebugSnapshotData struct { // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. DebugSnapshotData *InitialSnapshotData `protobuf:"bytes,10,opt,name=debug_snapshot_data,json=debugSnapshotData,proto3,oneof"` @@ -409,6 +422,8 @@ func (*Response_BlockUndoSignal) isResponse_Message() {} func (*Response_FatalError) isResponse_Message() {} +func (*Response_BlockScopedDatas) isResponse_Message() {} + func (*Response_DebugSnapshotData) isResponse_Message() {} func (*Response_DebugSnapshotComplete) isResponse_Message() {} @@ -468,6 +483,50 @@ func (x *BlockUndoSignal) GetLastValidCursor() string { return "" } +type BlockScopedDatas struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []*BlockScopedData `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockScopedDatas) Reset() { + *x = BlockScopedDatas{} + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockScopedDatas) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockScopedDatas) ProtoMessage() {} + +func (x *BlockScopedDatas) ProtoReflect() protoreflect.Message { + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockScopedDatas.ProtoReflect.Descriptor instead. +func (*BlockScopedDatas) Descriptor() ([]byte, []int) { + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{3} +} + +func (x *BlockScopedDatas) GetItems() []*BlockScopedData { + if x != nil { + return x.Items + } + return nil +} + type BlockScopedData struct { state protoimpl.MessageState `protogen:"open.v1"` Output *MapModuleOutput `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` @@ -493,7 +552,7 @@ type BlockScopedData struct { func (x *BlockScopedData) Reset() { *x = BlockScopedData{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -505,7 +564,7 @@ func (x *BlockScopedData) String() string { func (*BlockScopedData) ProtoMessage() {} func (x *BlockScopedData) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -518,7 +577,7 @@ func (x *BlockScopedData) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockScopedData.ProtoReflect.Descriptor instead. func (*BlockScopedData) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{3} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{4} } func (x *BlockScopedData) GetOutput() *MapModuleOutput { @@ -617,7 +676,7 @@ type SessionInit struct { func (x *SessionInit) Reset() { *x = SessionInit{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -629,7 +688,7 @@ func (x *SessionInit) String() string { func (*SessionInit) ProtoMessage() {} func (x *SessionInit) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -642,7 +701,7 @@ func (x *SessionInit) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionInit.ProtoReflect.Descriptor instead. func (*SessionInit) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{4} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{5} } func (x *SessionInit) GetTraceId() string { @@ -724,7 +783,7 @@ type InitialSnapshotComplete struct { func (x *InitialSnapshotComplete) Reset() { *x = InitialSnapshotComplete{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -736,7 +795,7 @@ func (x *InitialSnapshotComplete) String() string { func (*InitialSnapshotComplete) ProtoMessage() {} func (x *InitialSnapshotComplete) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -749,7 +808,7 @@ func (x *InitialSnapshotComplete) ProtoReflect() protoreflect.Message { // Deprecated: Use InitialSnapshotComplete.ProtoReflect.Descriptor instead. func (*InitialSnapshotComplete) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{5} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{6} } func (x *InitialSnapshotComplete) GetCursor() string { @@ -771,7 +830,7 @@ type InitialSnapshotData struct { func (x *InitialSnapshotData) Reset() { *x = InitialSnapshotData{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -783,7 +842,7 @@ func (x *InitialSnapshotData) String() string { func (*InitialSnapshotData) ProtoMessage() {} func (x *InitialSnapshotData) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -796,7 +855,7 @@ func (x *InitialSnapshotData) ProtoReflect() protoreflect.Message { // Deprecated: Use InitialSnapshotData.ProtoReflect.Descriptor instead. func (*InitialSnapshotData) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{6} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{7} } func (x *InitialSnapshotData) GetModuleName() string { @@ -839,7 +898,7 @@ type MapModuleOutput struct { func (x *MapModuleOutput) Reset() { *x = MapModuleOutput{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -851,7 +910,7 @@ func (x *MapModuleOutput) String() string { func (*MapModuleOutput) ProtoMessage() {} func (x *MapModuleOutput) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -864,7 +923,7 @@ func (x *MapModuleOutput) ProtoReflect() protoreflect.Message { // Deprecated: Use MapModuleOutput.ProtoReflect.Descriptor instead. func (*MapModuleOutput) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{7} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{8} } func (x *MapModuleOutput) GetName() string { @@ -903,7 +962,7 @@ type StoreModuleOutput struct { func (x *StoreModuleOutput) Reset() { *x = StoreModuleOutput{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -915,7 +974,7 @@ func (x *StoreModuleOutput) String() string { func (*StoreModuleOutput) ProtoMessage() {} func (x *StoreModuleOutput) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -928,7 +987,7 @@ func (x *StoreModuleOutput) ProtoReflect() protoreflect.Message { // Deprecated: Use StoreModuleOutput.ProtoReflect.Descriptor instead. func (*StoreModuleOutput) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{8} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{9} } func (x *StoreModuleOutput) GetName() string { @@ -965,7 +1024,7 @@ type OutputDebugInfo struct { func (x *OutputDebugInfo) Reset() { *x = OutputDebugInfo{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -977,7 +1036,7 @@ func (x *OutputDebugInfo) String() string { func (*OutputDebugInfo) ProtoMessage() {} func (x *OutputDebugInfo) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -990,7 +1049,7 @@ func (x *OutputDebugInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use OutputDebugInfo.ProtoReflect.Descriptor instead. func (*OutputDebugInfo) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{9} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{10} } func (x *OutputDebugInfo) GetLogs() []string { @@ -1031,7 +1090,7 @@ type ModulesProgress struct { func (x *ModulesProgress) Reset() { *x = ModulesProgress{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1043,7 +1102,7 @@ func (x *ModulesProgress) String() string { func (*ModulesProgress) ProtoMessage() {} func (x *ModulesProgress) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1056,7 +1115,7 @@ func (x *ModulesProgress) ProtoReflect() protoreflect.Message { // Deprecated: Use ModulesProgress.ProtoReflect.Descriptor instead. func (*ModulesProgress) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{10} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{11} } func (x *ModulesProgress) GetRunningJobs() []*Job { @@ -1104,7 +1163,7 @@ type ProcessedBytes struct { func (x *ProcessedBytes) Reset() { *x = ProcessedBytes{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1116,7 +1175,7 @@ func (x *ProcessedBytes) String() string { func (*ProcessedBytes) ProtoMessage() {} func (x *ProcessedBytes) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1129,7 +1188,7 @@ func (x *ProcessedBytes) ProtoReflect() protoreflect.Message { // Deprecated: Use ProcessedBytes.ProtoReflect.Descriptor instead. func (*ProcessedBytes) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{11} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{12} } func (x *ProcessedBytes) GetTotalBytesRead() uint64 { @@ -1160,7 +1219,7 @@ type Error struct { func (x *Error) Reset() { *x = Error{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1172,7 +1231,7 @@ func (x *Error) String() string { func (*Error) ProtoMessage() {} func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1185,7 +1244,7 @@ func (x *Error) ProtoReflect() protoreflect.Message { // Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{12} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{13} } func (x *Error) GetModule() string { @@ -1229,7 +1288,7 @@ type Job struct { func (x *Job) Reset() { *x = Job{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1241,7 +1300,7 @@ func (x *Job) String() string { func (*Job) ProtoMessage() {} func (x *Job) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1254,7 +1313,7 @@ func (x *Job) ProtoReflect() protoreflect.Message { // Deprecated: Use Job.ProtoReflect.Descriptor instead. func (*Job) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{13} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{14} } func (x *Job) GetStage() uint32 { @@ -1302,7 +1361,7 @@ type Stage struct { func (x *Stage) Reset() { *x = Stage{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1314,7 +1373,7 @@ func (x *Stage) String() string { func (*Stage) ProtoMessage() {} func (x *Stage) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1327,7 +1386,7 @@ func (x *Stage) ProtoReflect() protoreflect.Message { // Deprecated: Use Stage.ProtoReflect.Descriptor instead. func (*Stage) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{14} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{15} } func (x *Stage) GetModules() []string { @@ -1379,7 +1438,7 @@ type ModuleStats struct { func (x *ModuleStats) Reset() { *x = ModuleStats{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1391,7 +1450,7 @@ func (x *ModuleStats) String() string { func (*ModuleStats) ProtoMessage() {} func (x *ModuleStats) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1404,7 +1463,7 @@ func (x *ModuleStats) ProtoReflect() protoreflect.Message { // Deprecated: Use ModuleStats.ProtoReflect.Descriptor instead. func (*ModuleStats) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{15} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{16} } func (x *ModuleStats) GetName() string { @@ -1502,7 +1561,7 @@ type ExternalCallMetric struct { func (x *ExternalCallMetric) Reset() { *x = ExternalCallMetric{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1514,7 +1573,7 @@ func (x *ExternalCallMetric) String() string { func (*ExternalCallMetric) ProtoMessage() {} func (x *ExternalCallMetric) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1527,7 +1586,7 @@ func (x *ExternalCallMetric) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalCallMetric.ProtoReflect.Descriptor instead. func (*ExternalCallMetric) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{16} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{17} } func (x *ExternalCallMetric) GetName() string { @@ -1564,7 +1623,7 @@ type StoreDelta struct { func (x *StoreDelta) Reset() { *x = StoreDelta{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1576,7 +1635,7 @@ func (x *StoreDelta) String() string { func (*StoreDelta) ProtoMessage() {} func (x *StoreDelta) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1589,7 +1648,7 @@ func (x *StoreDelta) ProtoReflect() protoreflect.Message { // Deprecated: Use StoreDelta.ProtoReflect.Descriptor instead. func (*StoreDelta) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{17} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{18} } func (x *StoreDelta) GetOperation() StoreDelta_Operation { @@ -1637,7 +1696,7 @@ type BlockRange struct { func (x *BlockRange) Reset() { *x = BlockRange{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1649,7 +1708,7 @@ func (x *BlockRange) String() string { func (*BlockRange) ProtoMessage() {} func (x *BlockRange) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1662,7 +1721,7 @@ func (x *BlockRange) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockRange.ProtoReflect.Descriptor instead. func (*BlockRange) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{18} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{19} } func (x *BlockRange) GetStartBlock() uint64 { @@ -1698,21 +1757,24 @@ const file_sf_substreams_rpc_v2_service_proto_rawDesc = "" + "\x16limit_processed_blocks\x18\f \x01(\x04R\x14limitProcessedBlocks\x12,\n" + "\x12dev_output_modules\x18\r \x03(\tR\x10devOutputModules\x12A\n" + "\x1dprogress_messages_interval_ms\x18\x0e \x01(\x04R\x1aprogressMessagesIntervalMs\x12%\n" + - "\x0epartial_blocks\x18\x10 \x01(\bR\rpartialBlocksJ\x04\b\x0f\x10\x10\"\xc9\x04\n" + + "\x0epartial_blocks\x18\x10 \x01(\bR\rpartialBlocksJ\x04\b\x0f\x10\x10\"\xa1\x05\n" + "\bResponse\x12=\n" + "\asession\x18\x01 \x01(\v2!.sf.substreams.rpc.v2.SessionInitH\x00R\asession\x12C\n" + "\bprogress\x18\x02 \x01(\v2%.sf.substreams.rpc.v2.ModulesProgressH\x00R\bprogress\x12S\n" + "\x11block_scoped_data\x18\x03 \x01(\v2%.sf.substreams.rpc.v2.BlockScopedDataH\x00R\x0fblockScopedData\x12S\n" + "\x11block_undo_signal\x18\x04 \x01(\v2%.sf.substreams.rpc.v2.BlockUndoSignalH\x00R\x0fblockUndoSignal\x12>\n" + "\vfatal_error\x18\x05 \x01(\v2\x1b.sf.substreams.rpc.v2.ErrorH\x00R\n" + - "fatalError\x12[\n" + + "fatalError\x12V\n" + + "\x12block_scoped_datas\x18\x06 \x01(\v2&.sf.substreams.rpc.v2.BlockScopedDatasH\x00R\x10blockScopedDatas\x12[\n" + "\x13debug_snapshot_data\x18\n" + " \x01(\v2).sf.substreams.rpc.v2.InitialSnapshotDataH\x00R\x11debugSnapshotData\x12g\n" + "\x17debug_snapshot_complete\x18\v \x01(\v2-.sf.substreams.rpc.v2.InitialSnapshotCompleteH\x00R\x15debugSnapshotCompleteB\t\n" + "\amessage\"\x83\x01\n" + "\x0fBlockUndoSignal\x12D\n" + "\x10last_valid_block\x18\x01 \x01(\v2\x1a.sf.substreams.v1.BlockRefR\x0elastValidBlock\x12*\n" + - "\x11last_valid_cursor\x18\x02 \x01(\tR\x0flastValidCursor\"\xaf\x04\n" + + "\x11last_valid_cursor\x18\x02 \x01(\tR\x0flastValidCursor\"O\n" + + "\x10BlockScopedDatas\x12;\n" + + "\x05items\x18\x01 \x03(\v2%.sf.substreams.rpc.v2.BlockScopedDataR\x05items\"\xaf\x04\n" + "\x0fBlockScopedData\x12=\n" + "\x06output\x18\x01 \x01(\v2%.sf.substreams.rpc.v2.MapModuleOutputR\x06output\x12-\n" + "\x05clock\x18\x02 \x01(\v2\x17.sf.substreams.v1.ClockR\x05clock\x12\x16\n" + @@ -1849,70 +1911,73 @@ func file_sf_substreams_rpc_v2_service_proto_rawDescGZIP() []byte { } var file_sf_substreams_rpc_v2_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_sf_substreams_rpc_v2_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_sf_substreams_rpc_v2_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_sf_substreams_rpc_v2_service_proto_goTypes = []any{ (StoreDelta_Operation)(0), // 0: sf.substreams.rpc.v2.StoreDelta.Operation (*Request)(nil), // 1: sf.substreams.rpc.v2.Request (*Response)(nil), // 2: sf.substreams.rpc.v2.Response (*BlockUndoSignal)(nil), // 3: sf.substreams.rpc.v2.BlockUndoSignal - (*BlockScopedData)(nil), // 4: sf.substreams.rpc.v2.BlockScopedData - (*SessionInit)(nil), // 5: sf.substreams.rpc.v2.SessionInit - (*InitialSnapshotComplete)(nil), // 6: sf.substreams.rpc.v2.InitialSnapshotComplete - (*InitialSnapshotData)(nil), // 7: sf.substreams.rpc.v2.InitialSnapshotData - (*MapModuleOutput)(nil), // 8: sf.substreams.rpc.v2.MapModuleOutput - (*StoreModuleOutput)(nil), // 9: sf.substreams.rpc.v2.StoreModuleOutput - (*OutputDebugInfo)(nil), // 10: sf.substreams.rpc.v2.OutputDebugInfo - (*ModulesProgress)(nil), // 11: sf.substreams.rpc.v2.ModulesProgress - (*ProcessedBytes)(nil), // 12: sf.substreams.rpc.v2.ProcessedBytes - (*Error)(nil), // 13: sf.substreams.rpc.v2.Error - (*Job)(nil), // 14: sf.substreams.rpc.v2.Job - (*Stage)(nil), // 15: sf.substreams.rpc.v2.Stage - (*ModuleStats)(nil), // 16: sf.substreams.rpc.v2.ModuleStats - (*ExternalCallMetric)(nil), // 17: sf.substreams.rpc.v2.ExternalCallMetric - (*StoreDelta)(nil), // 18: sf.substreams.rpc.v2.StoreDelta - (*BlockRange)(nil), // 19: sf.substreams.rpc.v2.BlockRange - (*v1.Modules)(nil), // 20: sf.substreams.v1.Modules - (*v1.BlockRef)(nil), // 21: sf.substreams.v1.BlockRef - (*v1.Clock)(nil), // 22: sf.substreams.v1.Clock - (*anypb.Any)(nil), // 23: google.protobuf.Any - (*v2.InfoRequest)(nil), // 24: sf.firehose.v2.InfoRequest - (*v2.InfoResponse)(nil), // 25: sf.firehose.v2.InfoResponse + (*BlockScopedDatas)(nil), // 4: sf.substreams.rpc.v2.BlockScopedDatas + (*BlockScopedData)(nil), // 5: sf.substreams.rpc.v2.BlockScopedData + (*SessionInit)(nil), // 6: sf.substreams.rpc.v2.SessionInit + (*InitialSnapshotComplete)(nil), // 7: sf.substreams.rpc.v2.InitialSnapshotComplete + (*InitialSnapshotData)(nil), // 8: sf.substreams.rpc.v2.InitialSnapshotData + (*MapModuleOutput)(nil), // 9: sf.substreams.rpc.v2.MapModuleOutput + (*StoreModuleOutput)(nil), // 10: sf.substreams.rpc.v2.StoreModuleOutput + (*OutputDebugInfo)(nil), // 11: sf.substreams.rpc.v2.OutputDebugInfo + (*ModulesProgress)(nil), // 12: sf.substreams.rpc.v2.ModulesProgress + (*ProcessedBytes)(nil), // 13: sf.substreams.rpc.v2.ProcessedBytes + (*Error)(nil), // 14: sf.substreams.rpc.v2.Error + (*Job)(nil), // 15: sf.substreams.rpc.v2.Job + (*Stage)(nil), // 16: sf.substreams.rpc.v2.Stage + (*ModuleStats)(nil), // 17: sf.substreams.rpc.v2.ModuleStats + (*ExternalCallMetric)(nil), // 18: sf.substreams.rpc.v2.ExternalCallMetric + (*StoreDelta)(nil), // 19: sf.substreams.rpc.v2.StoreDelta + (*BlockRange)(nil), // 20: sf.substreams.rpc.v2.BlockRange + (*v1.Modules)(nil), // 21: sf.substreams.v1.Modules + (*v1.BlockRef)(nil), // 22: sf.substreams.v1.BlockRef + (*v1.Clock)(nil), // 23: sf.substreams.v1.Clock + (*anypb.Any)(nil), // 24: google.protobuf.Any + (*v2.InfoRequest)(nil), // 25: sf.firehose.v2.InfoRequest + (*v2.InfoResponse)(nil), // 26: sf.firehose.v2.InfoResponse } var file_sf_substreams_rpc_v2_service_proto_depIdxs = []int32{ - 20, // 0: sf.substreams.rpc.v2.Request.modules:type_name -> sf.substreams.v1.Modules - 5, // 1: sf.substreams.rpc.v2.Response.session:type_name -> sf.substreams.rpc.v2.SessionInit - 11, // 2: sf.substreams.rpc.v2.Response.progress:type_name -> sf.substreams.rpc.v2.ModulesProgress - 4, // 3: sf.substreams.rpc.v2.Response.block_scoped_data:type_name -> sf.substreams.rpc.v2.BlockScopedData + 21, // 0: sf.substreams.rpc.v2.Request.modules:type_name -> sf.substreams.v1.Modules + 6, // 1: sf.substreams.rpc.v2.Response.session:type_name -> sf.substreams.rpc.v2.SessionInit + 12, // 2: sf.substreams.rpc.v2.Response.progress:type_name -> sf.substreams.rpc.v2.ModulesProgress + 5, // 3: sf.substreams.rpc.v2.Response.block_scoped_data:type_name -> sf.substreams.rpc.v2.BlockScopedData 3, // 4: sf.substreams.rpc.v2.Response.block_undo_signal:type_name -> sf.substreams.rpc.v2.BlockUndoSignal - 13, // 5: sf.substreams.rpc.v2.Response.fatal_error:type_name -> sf.substreams.rpc.v2.Error - 7, // 6: sf.substreams.rpc.v2.Response.debug_snapshot_data:type_name -> sf.substreams.rpc.v2.InitialSnapshotData - 6, // 7: sf.substreams.rpc.v2.Response.debug_snapshot_complete:type_name -> sf.substreams.rpc.v2.InitialSnapshotComplete - 21, // 8: sf.substreams.rpc.v2.BlockUndoSignal.last_valid_block:type_name -> sf.substreams.v1.BlockRef - 8, // 9: sf.substreams.rpc.v2.BlockScopedData.output:type_name -> sf.substreams.rpc.v2.MapModuleOutput - 22, // 10: sf.substreams.rpc.v2.BlockScopedData.clock:type_name -> sf.substreams.v1.Clock - 8, // 11: sf.substreams.rpc.v2.BlockScopedData.debug_map_outputs:type_name -> sf.substreams.rpc.v2.MapModuleOutput - 9, // 12: sf.substreams.rpc.v2.BlockScopedData.debug_store_outputs:type_name -> sf.substreams.rpc.v2.StoreModuleOutput - 18, // 13: sf.substreams.rpc.v2.InitialSnapshotData.deltas:type_name -> sf.substreams.rpc.v2.StoreDelta - 23, // 14: sf.substreams.rpc.v2.MapModuleOutput.map_output:type_name -> google.protobuf.Any - 10, // 15: sf.substreams.rpc.v2.MapModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo - 18, // 16: sf.substreams.rpc.v2.StoreModuleOutput.debug_store_deltas:type_name -> sf.substreams.rpc.v2.StoreDelta - 10, // 17: sf.substreams.rpc.v2.StoreModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo - 14, // 18: sf.substreams.rpc.v2.ModulesProgress.running_jobs:type_name -> sf.substreams.rpc.v2.Job - 16, // 19: sf.substreams.rpc.v2.ModulesProgress.modules_stats:type_name -> sf.substreams.rpc.v2.ModuleStats - 15, // 20: sf.substreams.rpc.v2.ModulesProgress.stages:type_name -> sf.substreams.rpc.v2.Stage - 12, // 21: sf.substreams.rpc.v2.ModulesProgress.processed_bytes:type_name -> sf.substreams.rpc.v2.ProcessedBytes - 19, // 22: sf.substreams.rpc.v2.Stage.completed_ranges:type_name -> sf.substreams.rpc.v2.BlockRange - 17, // 23: sf.substreams.rpc.v2.ModuleStats.external_call_metrics:type_name -> sf.substreams.rpc.v2.ExternalCallMetric - 0, // 24: sf.substreams.rpc.v2.StoreDelta.operation:type_name -> sf.substreams.rpc.v2.StoreDelta.Operation - 1, // 25: sf.substreams.rpc.v2.Stream.Blocks:input_type -> sf.substreams.rpc.v2.Request - 24, // 26: sf.substreams.rpc.v2.EndpointInfo.Info:input_type -> sf.firehose.v2.InfoRequest - 2, // 27: sf.substreams.rpc.v2.Stream.Blocks:output_type -> sf.substreams.rpc.v2.Response - 25, // 28: sf.substreams.rpc.v2.EndpointInfo.Info:output_type -> sf.firehose.v2.InfoResponse - 27, // [27:29] is the sub-list for method output_type - 25, // [25:27] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 14, // 5: sf.substreams.rpc.v2.Response.fatal_error:type_name -> sf.substreams.rpc.v2.Error + 4, // 6: sf.substreams.rpc.v2.Response.block_scoped_datas:type_name -> sf.substreams.rpc.v2.BlockScopedDatas + 8, // 7: sf.substreams.rpc.v2.Response.debug_snapshot_data:type_name -> sf.substreams.rpc.v2.InitialSnapshotData + 7, // 8: sf.substreams.rpc.v2.Response.debug_snapshot_complete:type_name -> sf.substreams.rpc.v2.InitialSnapshotComplete + 22, // 9: sf.substreams.rpc.v2.BlockUndoSignal.last_valid_block:type_name -> sf.substreams.v1.BlockRef + 5, // 10: sf.substreams.rpc.v2.BlockScopedDatas.items:type_name -> sf.substreams.rpc.v2.BlockScopedData + 9, // 11: sf.substreams.rpc.v2.BlockScopedData.output:type_name -> sf.substreams.rpc.v2.MapModuleOutput + 23, // 12: sf.substreams.rpc.v2.BlockScopedData.clock:type_name -> sf.substreams.v1.Clock + 9, // 13: sf.substreams.rpc.v2.BlockScopedData.debug_map_outputs:type_name -> sf.substreams.rpc.v2.MapModuleOutput + 10, // 14: sf.substreams.rpc.v2.BlockScopedData.debug_store_outputs:type_name -> sf.substreams.rpc.v2.StoreModuleOutput + 19, // 15: sf.substreams.rpc.v2.InitialSnapshotData.deltas:type_name -> sf.substreams.rpc.v2.StoreDelta + 24, // 16: sf.substreams.rpc.v2.MapModuleOutput.map_output:type_name -> google.protobuf.Any + 11, // 17: sf.substreams.rpc.v2.MapModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo + 19, // 18: sf.substreams.rpc.v2.StoreModuleOutput.debug_store_deltas:type_name -> sf.substreams.rpc.v2.StoreDelta + 11, // 19: sf.substreams.rpc.v2.StoreModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo + 15, // 20: sf.substreams.rpc.v2.ModulesProgress.running_jobs:type_name -> sf.substreams.rpc.v2.Job + 17, // 21: sf.substreams.rpc.v2.ModulesProgress.modules_stats:type_name -> sf.substreams.rpc.v2.ModuleStats + 16, // 22: sf.substreams.rpc.v2.ModulesProgress.stages:type_name -> sf.substreams.rpc.v2.Stage + 13, // 23: sf.substreams.rpc.v2.ModulesProgress.processed_bytes:type_name -> sf.substreams.rpc.v2.ProcessedBytes + 20, // 24: sf.substreams.rpc.v2.Stage.completed_ranges:type_name -> sf.substreams.rpc.v2.BlockRange + 18, // 25: sf.substreams.rpc.v2.ModuleStats.external_call_metrics:type_name -> sf.substreams.rpc.v2.ExternalCallMetric + 0, // 26: sf.substreams.rpc.v2.StoreDelta.operation:type_name -> sf.substreams.rpc.v2.StoreDelta.Operation + 1, // 27: sf.substreams.rpc.v2.Stream.Blocks:input_type -> sf.substreams.rpc.v2.Request + 25, // 28: sf.substreams.rpc.v2.EndpointInfo.Info:input_type -> sf.firehose.v2.InfoRequest + 2, // 29: sf.substreams.rpc.v2.Stream.Blocks:output_type -> sf.substreams.rpc.v2.Response + 26, // 30: sf.substreams.rpc.v2.EndpointInfo.Info:output_type -> sf.firehose.v2.InfoResponse + 29, // [29:31] is the sub-list for method output_type + 27, // [27:29] is the sub-list for method input_type + 27, // [27:27] is the sub-list for extension type_name + 27, // [27:27] is the sub-list for extension extendee + 0, // [0:27] is the sub-list for field type_name } func init() { file_sf_substreams_rpc_v2_service_proto_init() } @@ -1926,17 +1991,18 @@ func file_sf_substreams_rpc_v2_service_proto_init() { (*Response_BlockScopedData)(nil), (*Response_BlockUndoSignal)(nil), (*Response_FatalError)(nil), + (*Response_BlockScopedDatas)(nil), (*Response_DebugSnapshotData)(nil), (*Response_DebugSnapshotComplete)(nil), } - file_sf_substreams_rpc_v2_service_proto_msgTypes[3].OneofWrappers = []any{} + file_sf_substreams_rpc_v2_service_proto_msgTypes[4].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_sf_substreams_rpc_v2_service_proto_rawDesc), len(file_sf_substreams_rpc_v2_service_proto_rawDesc)), NumEnums: 1, - NumMessages: 19, + NumMessages: 20, NumExtensions: 0, NumServices: 2, }, diff --git a/pb/sf/substreams/rpc/v2/service_grpc.pb.go b/pb/sf/substreams/rpc/v2/service_grpc.pb.go index 55d3b02c1..50d06b884 100644 --- a/pb/sf/substreams/rpc/v2/service_grpc.pb.go +++ b/pb/sf/substreams/rpc/v2/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.6.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: sf/substreams/rpc/v2/service.proto @@ -72,7 +72,7 @@ type StreamServer interface { type UnimplementedStreamServer struct{} func (UnimplementedStreamServer) Blocks(*Request, grpc.ServerStreamingServer[Response]) error { - return status.Error(codes.Unimplemented, "method Blocks not implemented") + return status.Errorf(codes.Unimplemented, "method Blocks not implemented") } func (UnimplementedStreamServer) testEmbeddedByValue() {} @@ -84,7 +84,7 @@ type UnsafeStreamServer interface { } func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer) { - // If the following call panics, it indicates UnimplementedStreamServer was + // If the following call pancis, it indicates UnimplementedStreamServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. @@ -166,7 +166,7 @@ type EndpointInfoServer interface { type UnimplementedEndpointInfoServer struct{} func (UnimplementedEndpointInfoServer) Info(context.Context, *v2.InfoRequest) (*v2.InfoResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Info not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") } func (UnimplementedEndpointInfoServer) testEmbeddedByValue() {} @@ -178,7 +178,7 @@ type UnsafeEndpointInfoServer interface { } func RegisterEndpointInfoServer(s grpc.ServiceRegistrar, srv EndpointInfoServer) { - // If the following call panics, it indicates UnimplementedEndpointInfoServer was + // If the following call pancis, it indicates UnimplementedEndpointInfoServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pb/sf/substreams/rpc/v3/service_grpc.pb.go b/pb/sf/substreams/rpc/v3/service_grpc.pb.go index e801d7c71..321d2bed5 100644 --- a/pb/sf/substreams/rpc/v3/service_grpc.pb.go +++ b/pb/sf/substreams/rpc/v3/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.6.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: sf/substreams/rpc/v3/service.proto @@ -84,7 +84,7 @@ type StreamServer interface { type UnimplementedStreamServer struct{} func (UnimplementedStreamServer) Blocks(*Request, grpc.ServerStreamingServer[v2.Response]) error { - return status.Error(codes.Unimplemented, "method Blocks not implemented") + return status.Errorf(codes.Unimplemented, "method Blocks not implemented") } func (UnimplementedStreamServer) testEmbeddedByValue() {} @@ -96,7 +96,7 @@ type UnsafeStreamServer interface { } func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer) { - // If the following call panics, it indicates UnimplementedStreamServer was + // If the following call pancis, it indicates UnimplementedStreamServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/pb/sf/substreams/sink/service/v1/service_grpc.pb.go b/pb/sf/substreams/sink/service/v1/service_grpc.pb.go index f1dd1f8d3..3c2a40116 100644 --- a/pb/sf/substreams/sink/service/v1/service_grpc.pb.go +++ b/pb/sf/substreams/sink/service/v1/service_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.6.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: sf/substreams/sink/service/v1/service.proto @@ -153,28 +153,28 @@ type ProviderServer interface { type UnimplementedProviderServer struct{} func (UnimplementedProviderServer) Deploy(context.Context, *DeployRequest) (*DeployResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Deploy not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Deploy not implemented") } func (UnimplementedProviderServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Update not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") } func (UnimplementedProviderServer) Info(context.Context, *InfoRequest) (*InfoResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Info not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") } func (UnimplementedProviderServer) List(context.Context, *ListRequest) (*ListResponse, error) { - return nil, status.Error(codes.Unimplemented, "method List not implemented") + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } func (UnimplementedProviderServer) Pause(context.Context, *PauseRequest) (*PauseResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Pause not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented") } func (UnimplementedProviderServer) Stop(context.Context, *StopRequest) (*StopResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Stop not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } func (UnimplementedProviderServer) Resume(context.Context, *ResumeRequest) (*ResumeResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Resume not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Resume not implemented") } func (UnimplementedProviderServer) Remove(context.Context, *RemoveRequest) (*RemoveResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Remove not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented") } func (UnimplementedProviderServer) testEmbeddedByValue() {} @@ -186,7 +186,7 @@ type UnsafeProviderServer interface { } func RegisterProviderServer(s grpc.ServiceRegistrar, srv ProviderServer) { - // If the following call panics, it indicates UnimplementedProviderServer was + // If the following call pancis, it indicates UnimplementedProviderServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/proto/sf/substreams/rpc/v2/service.proto b/proto/sf/substreams/rpc/v2/service.proto index fbaa383f2..ccecc9c47 100644 --- a/proto/sf/substreams/rpc/v2/service.proto +++ b/proto/sf/substreams/rpc/v2/service.proto @@ -85,6 +85,7 @@ message Response { BlockScopedData block_scoped_data = 3; BlockUndoSignal block_undo_signal = 4; Error fatal_error = 5; + BlockScopedDatas block_scoped_datas = 6; // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. InitialSnapshotData debug_snapshot_data = 10; @@ -103,6 +104,10 @@ message BlockUndoSignal { string last_valid_cursor = 2; } +message BlockScopedDatas { + repeated BlockScopedData items = 1; +} + message BlockScopedData { MapModuleOutput output = 1; sf.substreams.v1.Clock clock = 2; diff --git a/service/server.go b/service/server.go index a09e5a634..5c61891a7 100644 --- a/service/server.go +++ b/service/server.go @@ -1,48 +1,50 @@ package service import ( + "context" + "fmt" + "net/http" "net/url" "strings" "time" + "connectrpc.com/connect" + compress "github.com/klauspost/connect-compress/v2" _ "github.com/mostynb/go-grpc-compression/experimental/s2" _ "github.com/mostynb/go-grpc-compression/lz4" _ "github.com/mostynb/go-grpc-compression/zstd" + vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dauth" + dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" dgrpcserver "github.com/streamingfast/dgrpc/server" + connectweb "github.com/streamingfast/dgrpc/server/connectrpc" "github.com/streamingfast/dgrpc/server/factory" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" + tier1Connect "github.com/streamingfast/substreams/service/connect" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" "go.uber.org/zap" + "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" "google.golang.org/grpc" + "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/experimental" ) -func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { - tracerProvider := otel.GetTracerProvider() - options := []dgrpcserver.Option{ +func init() { + fmt.Println("------------------ VT Proto registered ------------------------") + encoding.RegisterCodec(vt.Codec{}) +} - dgrpcserver.WithLogger(logger), - dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), - dgrpcserver.WithGRPCServerOptions( - grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), - grpc.MaxRecvMsgSize(1024*1024*1024), - ), - } - if enforceCompression { - options = append(options, dgrpcserver.WithEnforceCompression()) - } +type streamHandlerV3 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error - if strings.Contains(listenAddr, "*") { - options = append(options, dgrpcserver.WithInsecureServer()) - } else { - options = append(options, dgrpcserver.WithPlainTextServer()) - } - return options +func (h streamHandlerV3) Blocks(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error { + return h(ctx, req, stream) } type v3Adapter struct { @@ -54,8 +56,14 @@ func (a *v3Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3 } func ListenTier1( - listenAddr string, + secureProxyListenAddress string, + plaintextProxyListenAddress string, + secureGrpcListenAddress string, + plaintextGrpcListenAddress string, + secureConnectListenAddress string, + plaintextConnectListenAddress string, svc *Tier1Service, + connectSvc *tier1Connect.Service, infoService pbsubstreamsrpc.EndpointInfoServer, auth dauth.Authenticator, logger *zap.Logger, @@ -63,50 +71,221 @@ func ListenTier1( enforceCompression bool, ) (err error) { - done := make(chan any) - - var servers []dgrpcserver.Server - for _, addr := range strings.Split(listenAddr, ",") { - // note: some of these common options don't work with connectWeb - options := GetCommonServerOptions(addr, logger, healthcheck, enforceCompression) - options = append(options, dgrpcserver.WithPostUnaryInterceptor(dauthgrpc.UnaryAuthChecker(auth, logger))) - options = append(options, dgrpcserver.WithPostStreamInterceptor(dauthgrpc.StreamAuthChecker(auth, logger))) - grpcServer := factory.ServerFromOptions(options...) - pbsubstreamsrpc.RegisterStreamServer(grpcServer.ServiceRegistrar(), svc) - pbsubstreamsrpcv3.RegisterStreamServer(grpcServer.ServiceRegistrar(), &v3Adapter{svc}) - if infoService != nil { - pbsubstreamsrpc.RegisterEndpointInfoServer(grpcServer.ServiceRegistrar(), infoService) - } - svc.OnTerminating(func(err error) { - logger.Info("Tier1Service is terminating") - grpcServer.Shutdown(30 * time.Second) - }) - cleanAddr := strings.ReplaceAll(addr, "*", "") - servers = append(servers, grpcServer) + var secureGrpcServer dgrpcserver.Server + var plaintextGrpcServer dgrpcserver.Server + var secureConnectServer dgrpcserver.Server + var plaintextConnectServer dgrpcserver.Server + if plaintextGrpcListenAddress != "" { + plaintextGrpcServer = grpcSever(plaintextGrpcListenAddress, svc, infoService, auth, healthcheck, enforceCompression, logger) go func() { - grpcServer.Launch(cleanAddr) - close(done) + logger.Info("starting grpc server", zap.String("address", plaintextGrpcListenAddress)) + plaintextGrpcServer.Launch(strings.ReplaceAll(plaintextGrpcListenAddress, "*", "")) }() } - <-done - for _, srv := range servers { - srv.Shutdown(0) + if secureGrpcListenAddress != "" { + secureGrpcServer = grpcSever(secureGrpcListenAddress, svc, infoService, auth, healthcheck, enforceCompression, logger) + go func() { + logger.Info("starting grpc server", zap.String("address", secureGrpcListenAddress)) + secureGrpcServer.Launch(strings.ReplaceAll(secureGrpcListenAddress, "*", "")) + }() + } + + if plaintextConnectListenAddress != "" { + plaintextConnectServer = connectServer(plaintextConnectListenAddress, connectSvc, infoService, auth, healthcheck, enforceCompression, logger) + go func() { + logger.Info("starting connect server", zap.String("address", plaintextConnectListenAddress)) + plaintextConnectServer.Launch(strings.ReplaceAll(plaintextConnectListenAddress, "*", "")) + }() + } + + if secureConnectListenAddress != "" { + secureConnectServer = connectServer(secureConnectListenAddress, connectSvc, infoService, auth, healthcheck, enforceCompression, logger) + go func() { + logger.Info("starting connect server", zap.String("address", secureConnectListenAddress)) + secureConnectServer.Launch(strings.ReplaceAll(secureConnectListenAddress, "*", "")) + }() + } + + // The main multiplexer / router + mux := http.NewServeMux() + + // Catch-all handler that decides based on Content-Type + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + contentType := r.Header.Get("Content-Type") + isSecure := r.TLS != nil + + // gRPC protocol starts with application/grpc + // gRPC-Web often uses application/grpc-web or application/grpc-web+proto + if strings.HasPrefix(contentType, "application/grpc") || + strings.HasPrefix(contentType, "application/grpc-web") { + + if isSecure { + logger.Debug("forwarding gRPC request over HTTPS") + secureGrpcServer.ServeHTTP(w, r) + return + } + logger.Debug("forwarding gRPC request over HTTP") + plaintextGrpcServer.ServeHTTP(w, r) + return + } + + // Connect protocol: application/connect+proto or application/connect+json + // Also catch JSON for REST-like testing + if strings.HasPrefix(contentType, "application/connect") || + contentType == "application/json" || + strings.Contains(contentType, "json") { // loose match for safety + + if isSecure { + logger.Debug("forwarding gRPC-Web request over HTTPS") + secureConnectServer.ServeHTTP(w, r) + return + } + + logger.Debug("forwarding gRPC-Web request over HTTP") + plaintextConnectServer.ServeHTTP(w, r) + + return + } + + // Fallback: could return 415 or route to one by default + http.Error(w, "Unsupported Content-Type for RPC", http.StatusUnsupportedMediaType) + }) + + // Support HTTP/1.1 → h2c upgrade + direct h2 + handler := h2c.NewHandler(mux, &http2.Server{}) + + logger.Info("starting secure proxy server", zap.String("address", secureProxyListenAddress)) + go func() { + if err := http.ListenAndServe(strings.ReplaceAll(secureProxyListenAddress, "*", ""), handler); err != nil { + logger.Error("failed to start secure proxy server", zap.Error(err)) + } + }() + logger.Info("starting plaintext proxy server", zap.String("address", plaintextProxyListenAddress)) + go func() { + if err := http.ListenAndServe(strings.ReplaceAll(plaintextProxyListenAddress, "*", ""), handler); err != nil { + logger.Error("failed to start secure proxy server", zap.Error(err)) + } + }() + + logger.Info("started") + + if secureGrpcServer != nil { + <-secureGrpcServer.Terminating() + logger.Info("secure gRPC server terminated", zap.Error(secureGrpcServer.Error())) + } + if plaintextGrpcServer != nil { + <-plaintextGrpcServer.Terminating() + logger.Info("secure gRPC server terminated", zap.Error(plaintextGrpcServer.Error())) + } + if secureConnectServer != nil { + <-secureConnectServer.Terminating() + logger.Info("secure gRPC server terminated", zap.Error(secureConnectServer.Error())) + } + if plaintextConnectServer != nil { + <-plaintextConnectServer.Terminating() + logger.Info("secure gRPC server terminated", zap.Error(plaintextConnectServer.Error())) + } + + return +} + +func grpcSever( + address string, + service *Tier1Service, + infoService pbsubstreamsrpc.EndpointInfoServer, + auth dauth.Authenticator, + healthcheck dgrpcserver.HealthCheck, + enforceCompression bool, + logger *zap.Logger, +) dgrpcserver.Server { + options := GetCommonServerOptions(address, logger, healthcheck, enforceCompression) + options = append(options, dgrpcserver.WithPostUnaryInterceptor(dauthgrpc.UnaryAuthChecker(auth, logger))) + options = append(options, dgrpcserver.WithPostStreamInterceptor(dauthgrpc.StreamAuthChecker(auth, logger))) + + server := factory.ServerFromOptions(options...) + pbsubstreamsrpc.RegisterStreamServer(server.ServiceRegistrar(), service) + pbsubstreamsrpcv3.RegisterStreamServer(server.ServiceRegistrar(), &v3Adapter{service}) + if infoService != nil { + pbsubstreamsrpc.RegisterEndpointInfoServer(server.ServiceRegistrar(), infoService) + } + + cleanAddr := strings.ReplaceAll(address, "*", "") + + service.OnTerminating(func(err error) { + logger.Info("Tier1Service is terminating", zap.String("address", cleanAddr), zap.Error(err)) + server.Shutdown(0) + }) + return server + +} + +func connectServer( + address string, + service *tier1Connect.Service, + infoService pbsubstreamsrpc.EndpointInfoServer, + auth dauth.Authenticator, + healthcheck dgrpcserver.HealthCheck, + enforceCompression bool, + logger *zap.Logger, +) dgrpcserver.Server { + options := GetConnectCommonServerOptions(address, logger, healthcheck, enforceCompression) + + options = append(options, dgrpcserver.WithConnectInterceptor(dauthconnect.NewAuthInterceptor(auth, logger))) + options = append(options, dgrpcserver.WithConnectStrictContentType(false)) + options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv2connect.StreamName)) + options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) + options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) + + //todo: move compression to dgrpc :-( + + streamHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { + var o []connect.HandlerOption + for _, opt := range opts { + o = append(o, opt) + } + o = append(o, compress.WithAll(compress.LevelBalanced)) + return pbsubstreamsrpcv2connect.NewStreamHandler(service, o...) + } + + streamHandlerGetterV3 := func(opts ...connect.HandlerOption) (string, http.Handler) { + handler := streamHandlerV3(service.BlocksV3) + var o []connect.HandlerOption + for _, opt := range opts { + o = append(o, opt) + } + o = append(o, compress.WithAll(compress.LevelBalanced)) + return pbsubstreamsrpcv3connect.NewStreamHandler(handler, o...) } - //GRRRRRRRRRRRRRR - //GRRRRRRRRRRRRRR + handlerGetters := []connectweb.HandlerGetter{streamHandlerGetter, streamHandlerGetterV3} - //for _, srv := range servers { - // <-srv.Terminated() - // if e := srv.Err(); e != nil { - // err = e + //GRRRRRRRRRRRRRRRRRRRR + //GRRRRRRRRRRRRRRRRRRRR + // FIX ME! + //GRRRRRRRRRRRRRRRRRRRR + //GRRRRRRRRRRRRRRRRRRRR + //if infoService != nil { + // infoHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { + // + // var o []connect.HandlerOption + // for _, opt := range opts { + // o = append(o, opt) + // } + // o = append(o, compress.WithAll(compress.LevelBalanced)) + // out, outh := pbsubstreamsrpcv2connect.NewEndpointInfoHandler(infoService, o...) + // return out, outh // } + // handlerGetters = append(handlerGetters, infoHandlerGetter) //} - //GRRRRRRRRRRRRRR - //GRRRRRRRRRRRRRR - return + options = append(options, dgrpcserver.WithConnectPermissiveCORS()) + server := connectweb.New(handlerGetters, options...) + server.OnTerminating(func(err error) { + logger.Info("Tier1Service is terminating") + server.Shutdown(time.Duration(0)) + }) + return server } func ListenTier2( @@ -132,7 +311,7 @@ func ListenTier2( svc.OnTerminating(func(err error) { logger.Info("Tier2Service is terminating") - grpcServer.Shutdown(30 * time.Second) + grpcServer.Shutdown(0) }) done := make(chan struct{}) @@ -147,3 +326,44 @@ func ListenTier2( return } + +func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { + tracerProvider := otel.GetTracerProvider() + options := []dgrpcserver.Option{ + + dgrpcserver.WithLogger(logger), + dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), + dgrpcserver.WithGRPCServerOptions( + grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), + grpc.MaxRecvMsgSize(1024*1024*1024), + ), + } + if enforceCompression { + options = append(options, dgrpcserver.WithEnforceCompression()) + } + + if strings.Contains(listenAddr, "*") { + options = append(options, dgrpcserver.WithInsecureServer()) + } else { + options = append(options, dgrpcserver.WithPlainTextServer()) + } + return options +} + +func GetConnectCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { + tracerProvider := otel.GetTracerProvider() + options := []dgrpcserver.Option{ + dgrpcserver.WithLogger(logger), + dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), + dgrpcserver.WithGRPCServerOptions( + grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), + grpc.MaxRecvMsgSize(1024*1024*1024), + ), + } + if strings.Contains(listenAddr, "*") { + options = append(options, dgrpcserver.WithInsecureServer()) + } else { + options = append(options, dgrpcserver.WithPlainTextServer()) + } + return options +} diff --git a/service/tier1.go b/service/tier1.go index c2624fb79..77a58deed 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -1097,7 +1097,15 @@ func configureLiveBackFillerFromQuickload(ctx context.Context, segmentSize uint6 return nil } -func tier1ResponseHandler(ctx context.Context, mut *sync.Mutex, logger *zap.Logger, streamSrv grpc.ServerStream, noop bool, stats *metrics.Stats, debugOutputForModules []string) substreams.ResponseFunc { +func tier1ResponseHandler( + ctx context.Context, + mut *sync.Mutex, + logger *zap.Logger, + streamSrv grpc.ServerStream, + noop bool, + stats *metrics.Stats, + debugOutputForModules []string, +) substreams.ResponseFunc { auth := dauth.FromContext(ctx) organizationID := auth.OrganizationID() apiKeyID := auth.APIKeyID() diff --git a/sink/sinker.go b/sink/sinker.go index e17c39c28..85200e688 100644 --- a/sink/sinker.go +++ b/sink/sinker.go @@ -633,76 +633,20 @@ func (s *Sinker) doRequest( s.Logger.Debug("received response Progress", zap.Reflect("progress", r)) } + case *pbsubstreamsrpc.Response_BlockScopedDatas: + for idx, item := range r.BlockScopedDatas.Items { + if activeCursor, receivedDataMessage, err = s.processBlockScopedData(ctx, handler, item, idx == 0, beforeReceive, &prevBlockTime, activeCursor); err != nil { + return activeCursor, receivedDataMessage, err + } + afterReceive = time.Now() + lastMessageWasData = true + } case *pbsubstreamsrpc.Response_BlockScopedData: - receivedDataMessage = true - if cursorLivenessChecker, ok := s.LivenessChecker.(*CursorBasedLivenessChecker); ok { - cursorLivenessChecker.CheckCursor(r.BlockScopedData.Cursor) + if activeCursor, receivedDataMessage, err = s.processBlockScopedData(ctx, handler, r.BlockScopedData, true, beforeReceive, &prevBlockTime, activeCursor); err != nil { + return activeCursor, receivedDataMessage, err } - afterReceive = time.Now() lastMessageWasData = true - AvgBlockWaitTime.AddElapsedTime(beforeReceive) - BlockWaitTime.SetFloat64(AvgBlockWaitTime.Average().Seconds()) - - blockTime := r.BlockScopedData.Clock.Timestamp.AsTime() - if !prevBlockTime.IsZero() { - AvgBlockTimeDelta.AddDuration(blockTime.Sub(prevBlockTime)) - BlockTimeDelta.SetFloat64(AvgBlockTimeDelta.Average().Seconds()) - } - prevBlockTime = blockTime - - block := bstream.NewBlockRef(r.BlockScopedData.Clock.Id, r.BlockScopedData.Clock.Number) - moduleOutput := r.BlockScopedData.Output - - if s.Tracer.Enabled() { - s.Logger.Debug("received response BlockScopedData", zap.Stringer("at", block), zap.String("module_name", moduleOutput.Name), zap.Int("payload_bytes", len(moduleOutput.MapOutput.Value))) - } - - // We record our stats before the buffer action, so user sees state of "stream" and not state of buffer - s.stats.RecordBlock(block) - HeadBlockNumber.SetUint64(block.Num()) - HeadBlockTimeDrift.SetBlockTime(r.BlockScopedData.Clock.Timestamp.AsTime()) - DataMessageCount.Inc() - ServerEgressBytes.AddInt(proto.Size(r.BlockScopedData)) - BackprocessingCompletion.SetUint64(1) - - cursor, err := NewCursor(r.BlockScopedData.Cursor) - if err != nil { - return activeCursor, receivedDataMessage, fmt.Errorf("invalid received cursor, 'bstream' library in here is probably not up to date: %w", err) - } - - activeCursor = cursor - - var dataToProcess []*pbsubstreamsrpc.BlockScopedData - if s.buffer == nil { - // No buffering, process directly - dataToProcess = []*pbsubstreamsrpc.BlockScopedData{r.BlockScopedData} - } else { - dataToProcess, err = s.buffer.HandleBlockScopedData(r.BlockScopedData) - if err != nil { - return activeCursor, receivedDataMessage, fmt.Errorf("buffer add block data: %w", err) - } - } - - for _, blockScopedData := range dataToProcess { - currentCursor, err := NewCursor(blockScopedData.Cursor) - if err != nil { - return activeCursor, receivedDataMessage, fmt.Errorf("invalid received cursor, 'bstream' library in here is probably not up to date: %w", err) - } - - var isLive *bool - if s.LivenessChecker != nil { - isLive = &blockNotLive - if s.LivenessChecker.IsLive(blockScopedData.Clock) { - isLive = &liveBlock - } - s.stats.SetLiveness(isLive) - } - - if err := handler.HandleBlockScopedData(ctx, blockScopedData, isLive, currentCursor); err != nil { - return activeCursor, receivedDataMessage, fmt.Errorf("handle BlockScopedData message at block %s: %w", block, err) - } - } case *pbsubstreamsrpc.Response_BlockUndoSignal: undoSignal := r.BlockUndoSignal @@ -780,6 +724,89 @@ func (s *Sinker) doRequest( } } +func (s *Sinker) processBlockScopedData( + ctx context.Context, + handler SinkerHandler, + data *pbsubstreamsrpc.BlockScopedData, + isFirstItem bool, + beforeReceive time.Time, + prevBlockTime *time.Time, + activeCursor *Cursor, +) (newCursor *Cursor, receivedDataMessage bool, err error) { + receivedDataMessage = true + if cursorLivenessChecker, ok := s.LivenessChecker.(*CursorBasedLivenessChecker); ok { + cursorLivenessChecker.CheckCursor(data.Cursor) + } + + if isFirstItem { + AvgBlockWaitTime.AddElapsedTime(beforeReceive) + BlockWaitTime.SetFloat64(AvgBlockWaitTime.Average().Seconds()) + } + + blockTime := data.Clock.Timestamp.AsTime() + if !prevBlockTime.IsZero() { + AvgBlockTimeDelta.AddDuration(blockTime.Sub(*prevBlockTime)) + BlockTimeDelta.SetFloat64(AvgBlockTimeDelta.Average().Seconds()) + } + *prevBlockTime = blockTime + + block := bstream.NewBlockRef(data.Clock.Id, data.Clock.Number) + moduleOutput := data.Output + + if s.Tracer.Enabled() { + s.Logger.Debug("received response BlockScopedData", zap.Stringer("at", block), zap.String("module_name", moduleOutput.Name), zap.Int("payload_bytes", len(moduleOutput.MapOutput.Value))) + } + + // We record our stats before the buffer action, so user sees state of "stream" and not state of buffer + s.stats.RecordBlock(block) + HeadBlockNumber.SetUint64(block.Num()) + HeadBlockTimeDrift.SetBlockTime(data.Clock.Timestamp.AsTime()) + DataMessageCount.Inc() + ServerEgressBytes.AddInt(proto.Size(data)) + BackprocessingCompletion.SetUint64(1) + + cursor, err := NewCursor(data.Cursor) + if err != nil { + return activeCursor, receivedDataMessage, fmt.Errorf("invalid received cursor, 'bstream' library in here is probably not up to date: %w", err) + } + + activeCursor = cursor + + var dataToProcess []*pbsubstreamsrpc.BlockScopedData + if s.buffer == nil { + // No buffering, process directly + dataToProcess = []*pbsubstreamsrpc.BlockScopedData{data} + } else { + var err error + dataToProcess, err = s.buffer.HandleBlockScopedData(data) + if err != nil { + return activeCursor, receivedDataMessage, fmt.Errorf("buffer add block data: %w", err) + } + } + + for _, blockScopedData := range dataToProcess { + currentCursor, err := NewCursor(blockScopedData.Cursor) + if err != nil { + return activeCursor, receivedDataMessage, fmt.Errorf("invalid received cursor, 'bstream' library in here is probably not up to date: %w", err) + } + + var isLive *bool + if s.LivenessChecker != nil { + isLive = &blockNotLive + if s.LivenessChecker.IsLive(blockScopedData.Clock) { + isLive = &liveBlock + } + s.stats.SetLiveness(isLive) + } + + if err := handler.HandleBlockScopedData(ctx, blockScopedData, isLive, currentCursor); err != nil { + return activeCursor, receivedDataMessage, fmt.Errorf("handle BlockScopedData message at block %s: %w", block, err) + } + } + + return activeCursor, true, nil +} + func stageString(i uint32) string { return fmt.Sprintf("stage %d", i) } diff --git a/types.go b/types.go index bdc39ff02..d264a6d72 100644 --- a/types.go +++ b/types.go @@ -18,6 +18,11 @@ func NewBlockScopedDataResponse(in *pbsubstreamsrpc.BlockScopedData) *pbsubstrea Message: &pbsubstreamsrpc.Response_BlockScopedData{BlockScopedData: in}, } } +func NewBlockScopedDatasResponse(in *pbsubstreamsrpc.BlockScopedDatas) *pbsubstreamsrpc.Response { + return &pbsubstreamsrpc.Response{ + Message: &pbsubstreamsrpc.Response_BlockScopedDatas{BlockScopedDatas: in}, + } +} func NewBlockScopedDataInternResponse(in *pbssinternal.BlockScopedData) *pbssinternal.ProcessRangeResponse { return &pbssinternal.ProcessRangeResponse{ Type: &pbssinternal.ProcessRangeResponse_BlockScopedData{BlockScopedData: in}, From dfc96aa1f1ea774f84b33c1a1388721a4d847e5c Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 10:51:22 -0500 Subject: [PATCH 10/47] SAdd missing file bump dgrpc --- go.mod | 5 +- go.sum | 10 +- .../v1/conversation_vtproto.pb.go | 7957 +++++++++++++++++ pb/sf/substreams/index/v1/keys_vtproto.pb.go | 208 + .../substreams/intern/v2/deltas_vtproto.pb.go | 1061 +++ .../intern/v2/service_vtproto.pb.go | 3671 ++++++++ pb/sf/substreams/options_vtproto.pb.go | 221 + pb/sf/substreams/rpc/v2/service_vtproto.pb.go | 7361 +++++++++++++++ pb/sf/substreams/rpc/v3/service_vtproto.pb.go | 912 ++ .../sink/service/v1/service_vtproto.pb.go | 5017 +++++++++++ pb/sf/substreams/v1/clock_vtproto.pb.go | 485 + pb/sf/substreams/v1/deltas_vtproto.pb.go | 564 ++ pb/sf/substreams/v1/modules_vtproto.pb.go | 4152 +++++++++ pb/sf/substreams/v1/package_vtproto.pb.go | 2087 +++++ pb/sf/substreams/v1/test/test_vtproto.pb.go | 779 ++ service/connect/service.go | 91 + 16 files changed, 34578 insertions(+), 3 deletions(-) create mode 100644 pb/sf/codegen/conversation/v1/conversation_vtproto.pb.go create mode 100644 pb/sf/substreams/index/v1/keys_vtproto.pb.go create mode 100644 pb/sf/substreams/intern/v2/deltas_vtproto.pb.go create mode 100644 pb/sf/substreams/intern/v2/service_vtproto.pb.go create mode 100644 pb/sf/substreams/options_vtproto.pb.go create mode 100644 pb/sf/substreams/rpc/v2/service_vtproto.pb.go create mode 100644 pb/sf/substreams/rpc/v3/service_vtproto.pb.go create mode 100644 pb/sf/substreams/sink/service/v1/service_vtproto.pb.go create mode 100644 pb/sf/substreams/v1/clock_vtproto.pb.go create mode 100644 pb/sf/substreams/v1/deltas_vtproto.pb.go create mode 100644 pb/sf/substreams/v1/modules_vtproto.pb.go create mode 100644 pb/sf/substreams/v1/package_vtproto.pb.go create mode 100644 pb/sf/substreams/v1/test/test_vtproto.pb.go create mode 100644 service/connect/service.go diff --git a/go.mod b/go.mod index 95920b906..c7d6787a4 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260206130010-7b182ca29e1d + github.com/streamingfast/dgrpc v0.0.0-20260210154506-666c5437f4e6 github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 @@ -97,6 +97,9 @@ require ( cel.dev/expr v0.24.0 // indirect cloud.google.com/go/auth v0.17.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect + connectrpc.com/grpchealth v1.3.0 // indirect + connectrpc.com/grpcreflect v1.3.0 // indirect + connectrpc.com/otelconnect v0.8.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect diff --git a/go.sum b/go.sum index 4a170ff5c..dc4966039 100644 --- a/go.sum +++ b/go.sum @@ -64,6 +64,12 @@ cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4 cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI= connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14= connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= +connectrpc.com/grpchealth v1.3.0 h1:FA3OIwAvuMokQIXQrY5LbIy8IenftksTP/lG4PbYN+E= +connectrpc.com/grpchealth v1.3.0/go.mod h1:3vpqmX25/ir0gVgW6RdnCPPZRcR6HvqtXX5RNPmDXHM= +connectrpc.com/grpcreflect v1.3.0 h1:Y4V+ACf8/vOb1XOc251Qun7jMB75gCUNw6llvB9csXc= +connectrpc.com/grpcreflect v1.3.0/go.mod h1:nfloOtCS8VUQOQ1+GTdFzVg2CJo4ZGaat8JIovCtDYs= +connectrpc.com/otelconnect v0.8.0 h1:a4qrN4H8aEE2jAoCxheZYYfEjXMgVPyL9OzPQLBEFXU= +connectrpc.com/otelconnect v0.8.0/go.mod h1:AEkVLjCPXra+ObGFCOClcJkNjS7zPaQSqvO0lCyjfZc= contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc= @@ -553,8 +559,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20260206130010-7b182ca29e1d h1:of9deUKR0hED+nqdEtL0S9bQsZ65+qJ1QN0U4l9/8kc= -github.com/streamingfast/dgrpc v0.0.0-20260206130010-7b182ca29e1d/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= +github.com/streamingfast/dgrpc v0.0.0-20260210154506-666c5437f4e6 h1:VDqT97gPCyCxsydarUmK4aU/R/IreRFjY4a5TT/0xgA= +github.com/streamingfast/dgrpc v0.0.0-20260210154506-666c5437f4e6/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= diff --git a/pb/sf/codegen/conversation/v1/conversation_vtproto.pb.go b/pb/sf/codegen/conversation/v1/conversation_vtproto.pb.go new file mode 100644 index 000000000..4c47ccede --- /dev/null +++ b/pb/sf/codegen/conversation/v1/conversation_vtproto.pb.go @@ -0,0 +1,7957 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/codegen/conversation/v1/conversation.proto + +package pbconvo + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *Empty) CloneVT() *Empty { + if m == nil { + return (*Empty)(nil) + } + r := new(Empty) + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Empty) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_TextInput) CloneVT() *UserInput_TextInput { + if m == nil { + return (*UserInput_TextInput)(nil) + } + r := new(UserInput_TextInput) + r.Value = m.Value + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_TextInput) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_LocalFile) CloneVT() *UserInput_LocalFile { + if m == nil { + return (*UserInput_LocalFile)(nil) + } + r := new(UserInput_LocalFile) + if rhs := m.Value; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Value = tmpBytes + } + if rhs := m.Error; rhs != nil { + tmpVal := *rhs + r.Error = &tmpVal + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_LocalFile) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_Start) CloneVT() *UserInput_Start { + if m == nil { + return (*UserInput_Start)(nil) + } + r := new(UserInput_Start) + r.GeneratorId = m.GeneratorId + r.Hydrate = m.Hydrate.CloneVT() + r.Version = m.Version + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_Start) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_Hydrate) CloneVT() *UserInput_Hydrate { + if m == nil { + return (*UserInput_Hydrate)(nil) + } + r := new(UserInput_Hydrate) + r.SavedState = m.SavedState + r.LastMsgId = m.LastMsgId + r.ResetConversation = m.ResetConversation + if rhs := m.Signature; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Signature = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_Hydrate) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_Upload) CloneVT() *UserInput_Upload { + if m == nil { + return (*UserInput_Upload)(nil) + } + r := new(UserInput_Upload) + r.MimeType = m.MimeType + r.Filename = m.Filename + if rhs := m.Content; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Content = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_Upload) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_Selection) CloneVT() *UserInput_Selection { + if m == nil { + return (*UserInput_Selection)(nil) + } + r := new(UserInput_Selection) + r.Label = m.Label + r.Value = m.Value + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_Selection) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_Confirmation) CloneVT() *UserInput_Confirmation { + if m == nil { + return (*UserInput_Confirmation)(nil) + } + r := new(UserInput_Confirmation) + r.Affirmative = m.Affirmative + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_Confirmation) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_DownloadedFiles) CloneVT() *UserInput_DownloadedFiles { + if m == nil { + return (*UserInput_DownloadedFiles)(nil) + } + r := new(UserInput_DownloadedFiles) + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput_DownloadedFiles) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput) CloneVT() *UserInput { + if m == nil { + return (*UserInput)(nil) + } + r := new(UserInput) + r.MsgId = m.MsgId + r.FromMsgId = m.FromMsgId + r.FromActionId = m.FromActionId + if m.Entry != nil { + r.Entry = m.Entry.(interface{ CloneVT() isUserInput_Entry }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UserInput) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UserInput_Start_) CloneVT() isUserInput_Entry { + if m == nil { + return (*UserInput_Start_)(nil) + } + r := new(UserInput_Start_) + r.Start = m.Start.CloneVT() + return r +} + +func (m *UserInput_TextInput_) CloneVT() isUserInput_Entry { + if m == nil { + return (*UserInput_TextInput_)(nil) + } + r := new(UserInput_TextInput_) + r.TextInput = m.TextInput.CloneVT() + return r +} + +func (m *UserInput_Selection_) CloneVT() isUserInput_Entry { + if m == nil { + return (*UserInput_Selection_)(nil) + } + r := new(UserInput_Selection_) + r.Selection = m.Selection.CloneVT() + return r +} + +func (m *UserInput_Confirmation_) CloneVT() isUserInput_Entry { + if m == nil { + return (*UserInput_Confirmation_)(nil) + } + r := new(UserInput_Confirmation_) + r.Confirmation = m.Confirmation.CloneVT() + return r +} + +func (m *UserInput_File) CloneVT() isUserInput_Entry { + if m == nil { + return (*UserInput_File)(nil) + } + r := new(UserInput_File) + r.File = m.File.CloneVT() + return r +} + +func (m *UserInput_DownloadedFiles_) CloneVT() isUserInput_Entry { + if m == nil { + return (*UserInput_DownloadedFiles_)(nil) + } + r := new(UserInput_DownloadedFiles_) + r.DownloadedFiles = m.DownloadedFiles.CloneVT() + return r +} + +func (m *UserInput_LocalFile_) CloneVT() isUserInput_Entry { + if m == nil { + return (*UserInput_LocalFile_)(nil) + } + r := new(UserInput_LocalFile_) + r.LocalFile = m.LocalFile.CloneVT() + return r +} + +func (m *SystemOutput_Message) CloneVT() *SystemOutput_Message { + if m == nil { + return (*SystemOutput_Message)(nil) + } + r := new(SystemOutput_Message) + r.Markdown = m.Markdown + r.Style = m.Style + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_Message) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_ImageWithText) CloneVT() *SystemOutput_ImageWithText { + if m == nil { + return (*SystemOutput_ImageWithText)(nil) + } + r := new(SystemOutput_ImageWithText) + r.ImgUrl = m.ImgUrl + r.Markdown = m.Markdown + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_ImageWithText) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_ListSelect) CloneVT() *SystemOutput_ListSelect { + if m == nil { + return (*SystemOutput_ListSelect)(nil) + } + r := new(SystemOutput_ListSelect) + r.Id = m.Id + r.Instructions = m.Instructions + r.SelectMany = m.SelectMany + r.SelectType = m.SelectType + r.SelectButtonLabel = m.SelectButtonLabel + r.DefaultValue = m.DefaultValue + if rhs := m.Labels; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Labels = tmpContainer + } + if rhs := m.Values; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Values = tmpContainer + } + if rhs := m.ImageUrls; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.ImageUrls = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_ListSelect) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_TextInput) CloneVT() *SystemOutput_TextInput { + if m == nil { + return (*SystemOutput_TextInput)(nil) + } + r := new(SystemOutput_TextInput) + r.Prompt = m.Prompt + r.Description = m.Description + r.Placeholder = m.Placeholder + r.DefaultValue = m.DefaultValue + r.MultiLine = m.MultiLine + r.ValidationRegexp = m.ValidationRegexp + r.ValidationErrorMessage = m.ValidationErrorMessage + r.SubmitButtonLabel = m.SubmitButtonLabel + r.SubmitButtonIcon = m.SubmitButtonIcon + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_TextInput) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_LocalFile) CloneVT() *SystemOutput_LocalFile { + if m == nil { + return (*SystemOutput_LocalFile)(nil) + } + r := new(SystemOutput_LocalFile) + r.Prompt = m.Prompt + r.Description = m.Description + r.Placeholder = m.Placeholder + r.DefaultValue = m.DefaultValue + r.SubmitButtonLabel = m.SubmitButtonLabel + r.SubmitButtonIcon = m.SubmitButtonIcon + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_LocalFile) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_Loading) CloneVT() *SystemOutput_Loading { + if m == nil { + return (*SystemOutput_Loading)(nil) + } + r := new(SystemOutput_Loading) + r.Loading = m.Loading + r.Label = m.Label + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_Loading) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_DownloadFiles) CloneVT() *SystemOutput_DownloadFiles { + if m == nil { + return (*SystemOutput_DownloadFiles)(nil) + } + r := new(SystemOutput_DownloadFiles) + if rhs := m.Files; rhs != nil { + tmpContainer := make([]*SystemOutput_DownloadFile, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Files = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_DownloadFiles) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_DownloadFile) CloneVT() *SystemOutput_DownloadFile { + if m == nil { + return (*SystemOutput_DownloadFile)(nil) + } + r := new(SystemOutput_DownloadFile) + r.Filename = m.Filename + r.Type = m.Type + r.Description = m.Description + if rhs := m.Content; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Content = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_DownloadFile) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_Confirm) CloneVT() *SystemOutput_Confirm { + if m == nil { + return (*SystemOutput_Confirm)(nil) + } + r := new(SystemOutput_Confirm) + r.Prompt = m.Prompt + r.Description = m.Description + r.AcceptButtonLabel = m.AcceptButtonLabel + r.DeclineButtonLabel = m.DeclineButtonLabel + r.DefaultButton = m.DefaultButton + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput_Confirm) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput) CloneVT() *SystemOutput { + if m == nil { + return (*SystemOutput)(nil) + } + r := new(SystemOutput) + r.MsgId = m.MsgId + r.FromMsgId = m.FromMsgId + r.ActionId = m.ActionId + r.State = m.State + if rhs := m.StateSignature; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.StateSignature = tmpBytes + } + if m.Entry != nil { + r.Entry = m.Entry.(interface{ CloneVT() isSystemOutput_Entry }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SystemOutput) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SystemOutput_Message_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_Message_)(nil) + } + r := new(SystemOutput_Message_) + r.Message = m.Message.CloneVT() + return r +} + +func (m *SystemOutput_ImageWithText_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_ImageWithText_)(nil) + } + r := new(SystemOutput_ImageWithText_) + r.ImageWithText = m.ImageWithText.CloneVT() + return r +} + +func (m *SystemOutput_ListSelect_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_ListSelect_)(nil) + } + r := new(SystemOutput_ListSelect_) + r.ListSelect = m.ListSelect.CloneVT() + return r +} + +func (m *SystemOutput_TextInput_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_TextInput_)(nil) + } + r := new(SystemOutput_TextInput_) + r.TextInput = m.TextInput.CloneVT() + return r +} + +func (m *SystemOutput_Confirm_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_Confirm_)(nil) + } + r := new(SystemOutput_Confirm_) + r.Confirm = m.Confirm.CloneVT() + return r +} + +func (m *SystemOutput_Loading_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_Loading_)(nil) + } + r := new(SystemOutput_Loading_) + r.Loading = m.Loading.CloneVT() + return r +} + +func (m *SystemOutput_DownloadFiles_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_DownloadFiles_)(nil) + } + r := new(SystemOutput_DownloadFiles_) + r.DownloadFiles = m.DownloadFiles.CloneVT() + return r +} + +func (m *SystemOutput_LocalFile_) CloneVT() isSystemOutput_Entry { + if m == nil { + return (*SystemOutput_LocalFile_)(nil) + } + r := new(SystemOutput_LocalFile_) + r.LocalFile = m.LocalFile.CloneVT() + return r +} + +func (m *DiscoveryRequest) CloneVT() *DiscoveryRequest { + if m == nil { + return (*DiscoveryRequest)(nil) + } + r := new(DiscoveryRequest) + r.SearchTerms = m.SearchTerms + r.ClientVersion = m.ClientVersion + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *DiscoveryRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *DiscoveryResponse_Generator) CloneVT() *DiscoveryResponse_Generator { + if m == nil { + return (*DiscoveryResponse_Generator)(nil) + } + r := new(DiscoveryResponse_Generator) + r.Id = m.Id + r.Title = m.Title + r.Description = m.Description + r.IconUrl = m.IconUrl + r.Endpoint = m.Endpoint + r.Group = m.Group + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *DiscoveryResponse_Generator) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *DiscoveryResponse) CloneVT() *DiscoveryResponse { + if m == nil { + return (*DiscoveryResponse)(nil) + } + r := new(DiscoveryResponse) + if rhs := m.Generators; rhs != nil { + tmpContainer := make([]*DiscoveryResponse_Generator, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Generators = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *DiscoveryResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Empty) EqualVT(that *Empty) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Empty) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Empty) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_TextInput) EqualVT(that *UserInput_TextInput) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Value != that.Value { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_TextInput) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_TextInput) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_LocalFile) EqualVT(that *UserInput_LocalFile) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if string(this.Value) != string(that.Value) { + return false + } + if p, q := this.Error, that.Error; (p == nil && q != nil) || (p != nil && (q == nil || *p != *q)) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_LocalFile) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_LocalFile) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_Start) EqualVT(that *UserInput_Start) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.GeneratorId != that.GeneratorId { + return false + } + if !this.Hydrate.EqualVT(that.Hydrate) { + return false + } + if this.Version != that.Version { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_Start) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_Start) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_Hydrate) EqualVT(that *UserInput_Hydrate) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.SavedState != that.SavedState { + return false + } + if string(this.Signature) != string(that.Signature) { + return false + } + if this.LastMsgId != that.LastMsgId { + return false + } + if this.ResetConversation != that.ResetConversation { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_Hydrate) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_Hydrate) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_Upload) EqualVT(that *UserInput_Upload) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.MimeType != that.MimeType { + return false + } + if this.Filename != that.Filename { + return false + } + if string(this.Content) != string(that.Content) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_Upload) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_Upload) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_Selection) EqualVT(that *UserInput_Selection) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Label != that.Label { + return false + } + if this.Value != that.Value { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_Selection) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_Selection) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_Confirmation) EqualVT(that *UserInput_Confirmation) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Affirmative != that.Affirmative { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_Confirmation) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_Confirmation) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_DownloadedFiles) EqualVT(that *UserInput_DownloadedFiles) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput_DownloadedFiles) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput_DownloadedFiles) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput) EqualVT(that *UserInput) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Entry == nil && that.Entry != nil { + return false + } else if this.Entry != nil { + if that.Entry == nil { + return false + } + if !this.Entry.(interface{ EqualVT(isUserInput_Entry) bool }).EqualVT(that.Entry) { + return false + } + } + if this.MsgId != that.MsgId { + return false + } + if this.FromMsgId != that.FromMsgId { + return false + } + if this.FromActionId != that.FromActionId { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UserInput) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UserInput) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UserInput_Start_) EqualVT(thatIface isUserInput_Entry) bool { + that, ok := thatIface.(*UserInput_Start_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Start, that.Start; p != q { + if p == nil { + p = &UserInput_Start{} + } + if q == nil { + q = &UserInput_Start{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *UserInput_TextInput_) EqualVT(thatIface isUserInput_Entry) bool { + that, ok := thatIface.(*UserInput_TextInput_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.TextInput, that.TextInput; p != q { + if p == nil { + p = &UserInput_TextInput{} + } + if q == nil { + q = &UserInput_TextInput{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *UserInput_File) EqualVT(thatIface isUserInput_Entry) bool { + that, ok := thatIface.(*UserInput_File) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.File, that.File; p != q { + if p == nil { + p = &UserInput_Upload{} + } + if q == nil { + q = &UserInput_Upload{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *UserInput_Selection_) EqualVT(thatIface isUserInput_Entry) bool { + that, ok := thatIface.(*UserInput_Selection_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Selection, that.Selection; p != q { + if p == nil { + p = &UserInput_Selection{} + } + if q == nil { + q = &UserInput_Selection{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *UserInput_Confirmation_) EqualVT(thatIface isUserInput_Entry) bool { + that, ok := thatIface.(*UserInput_Confirmation_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Confirmation, that.Confirmation; p != q { + if p == nil { + p = &UserInput_Confirmation{} + } + if q == nil { + q = &UserInput_Confirmation{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *UserInput_DownloadedFiles_) EqualVT(thatIface isUserInput_Entry) bool { + that, ok := thatIface.(*UserInput_DownloadedFiles_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.DownloadedFiles, that.DownloadedFiles; p != q { + if p == nil { + p = &UserInput_DownloadedFiles{} + } + if q == nil { + q = &UserInput_DownloadedFiles{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *UserInput_LocalFile_) EqualVT(thatIface isUserInput_Entry) bool { + that, ok := thatIface.(*UserInput_LocalFile_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.LocalFile, that.LocalFile; p != q { + if p == nil { + p = &UserInput_LocalFile{} + } + if q == nil { + q = &UserInput_LocalFile{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_Message) EqualVT(that *SystemOutput_Message) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Markdown != that.Markdown { + return false + } + if this.Style != that.Style { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_Message) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_Message) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_ImageWithText) EqualVT(that *SystemOutput_ImageWithText) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.ImgUrl != that.ImgUrl { + return false + } + if this.Markdown != that.Markdown { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_ImageWithText) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_ImageWithText) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_ListSelect) EqualVT(that *SystemOutput_ListSelect) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if len(this.Labels) != len(that.Labels) { + return false + } + for i, vx := range this.Labels { + vy := that.Labels[i] + if vx != vy { + return false + } + } + if len(this.Values) != len(that.Values) { + return false + } + for i, vx := range this.Values { + vy := that.Values[i] + if vx != vy { + return false + } + } + if len(this.ImageUrls) != len(that.ImageUrls) { + return false + } + for i, vx := range this.ImageUrls { + vy := that.ImageUrls[i] + if vx != vy { + return false + } + } + if this.SelectButtonLabel != that.SelectButtonLabel { + return false + } + if this.Instructions != that.Instructions { + return false + } + if this.SelectType != that.SelectType { + return false + } + if this.SelectMany != that.SelectMany { + return false + } + if this.DefaultValue != that.DefaultValue { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_ListSelect) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_ListSelect) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_TextInput) EqualVT(that *SystemOutput_TextInput) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Description != that.Description { + return false + } + if this.Placeholder != that.Placeholder { + return false + } + if this.MultiLine != that.MultiLine { + return false + } + if this.ValidationRegexp != that.ValidationRegexp { + return false + } + if this.ValidationErrorMessage != that.ValidationErrorMessage { + return false + } + if this.SubmitButtonLabel != that.SubmitButtonLabel { + return false + } + if this.SubmitButtonIcon != that.SubmitButtonIcon { + return false + } + if this.Prompt != that.Prompt { + return false + } + if this.DefaultValue != that.DefaultValue { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_TextInput) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_TextInput) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_LocalFile) EqualVT(that *SystemOutput_LocalFile) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Description != that.Description { + return false + } + if this.Placeholder != that.Placeholder { + return false + } + if this.SubmitButtonLabel != that.SubmitButtonLabel { + return false + } + if this.SubmitButtonIcon != that.SubmitButtonIcon { + return false + } + if this.Prompt != that.Prompt { + return false + } + if this.DefaultValue != that.DefaultValue { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_LocalFile) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_LocalFile) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_Loading) EqualVT(that *SystemOutput_Loading) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Loading != that.Loading { + return false + } + if this.Label != that.Label { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_Loading) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_Loading) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_DownloadFiles) EqualVT(that *SystemOutput_DownloadFiles) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Files) != len(that.Files) { + return false + } + for i, vx := range this.Files { + vy := that.Files[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &SystemOutput_DownloadFile{} + } + if q == nil { + q = &SystemOutput_DownloadFile{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_DownloadFiles) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_DownloadFiles) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_DownloadFile) EqualVT(that *SystemOutput_DownloadFile) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Filename != that.Filename { + return false + } + if this.Type != that.Type { + return false + } + if string(this.Content) != string(that.Content) { + return false + } + if this.Description != that.Description { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_DownloadFile) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_DownloadFile) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_Confirm) EqualVT(that *SystemOutput_Confirm) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Prompt != that.Prompt { + return false + } + if this.AcceptButtonLabel != that.AcceptButtonLabel { + return false + } + if this.DeclineButtonLabel != that.DeclineButtonLabel { + return false + } + if this.Description != that.Description { + return false + } + if this.DefaultButton != that.DefaultButton { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput_Confirm) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput_Confirm) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput) EqualVT(that *SystemOutput) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Entry == nil && that.Entry != nil { + return false + } else if this.Entry != nil { + if that.Entry == nil { + return false + } + if !this.Entry.(interface { + EqualVT(isSystemOutput_Entry) bool + }).EqualVT(that.Entry) { + return false + } + } + if this.MsgId != that.MsgId { + return false + } + if this.FromMsgId != that.FromMsgId { + return false + } + if this.ActionId != that.ActionId { + return false + } + if this.State != that.State { + return false + } + if string(this.StateSignature) != string(that.StateSignature) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SystemOutput) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SystemOutput) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SystemOutput_Message_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_Message_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Message, that.Message; p != q { + if p == nil { + p = &SystemOutput_Message{} + } + if q == nil { + q = &SystemOutput_Message{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_ImageWithText_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_ImageWithText_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.ImageWithText, that.ImageWithText; p != q { + if p == nil { + p = &SystemOutput_ImageWithText{} + } + if q == nil { + q = &SystemOutput_ImageWithText{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_ListSelect_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_ListSelect_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.ListSelect, that.ListSelect; p != q { + if p == nil { + p = &SystemOutput_ListSelect{} + } + if q == nil { + q = &SystemOutput_ListSelect{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_TextInput_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_TextInput_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.TextInput, that.TextInput; p != q { + if p == nil { + p = &SystemOutput_TextInput{} + } + if q == nil { + q = &SystemOutput_TextInput{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_Loading_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_Loading_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Loading, that.Loading; p != q { + if p == nil { + p = &SystemOutput_Loading{} + } + if q == nil { + q = &SystemOutput_Loading{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_DownloadFiles_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_DownloadFiles_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.DownloadFiles, that.DownloadFiles; p != q { + if p == nil { + p = &SystemOutput_DownloadFiles{} + } + if q == nil { + q = &SystemOutput_DownloadFiles{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_Confirm_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_Confirm_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Confirm, that.Confirm; p != q { + if p == nil { + p = &SystemOutput_Confirm{} + } + if q == nil { + q = &SystemOutput_Confirm{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *SystemOutput_LocalFile_) EqualVT(thatIface isSystemOutput_Entry) bool { + that, ok := thatIface.(*SystemOutput_LocalFile_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.LocalFile, that.LocalFile; p != q { + if p == nil { + p = &SystemOutput_LocalFile{} + } + if q == nil { + q = &SystemOutput_LocalFile{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *DiscoveryRequest) EqualVT(that *DiscoveryRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.SearchTerms != that.SearchTerms { + return false + } + if this.ClientVersion != that.ClientVersion { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *DiscoveryRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*DiscoveryRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *DiscoveryResponse_Generator) EqualVT(that *DiscoveryResponse_Generator) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if this.Title != that.Title { + return false + } + if this.Description != that.Description { + return false + } + if this.IconUrl != that.IconUrl { + return false + } + if this.Endpoint != that.Endpoint { + return false + } + if this.Group != that.Group { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *DiscoveryResponse_Generator) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*DiscoveryResponse_Generator) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *DiscoveryResponse) EqualVT(that *DiscoveryResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Generators) != len(that.Generators) { + return false + } + for i, vx := range this.Generators { + vy := that.Generators[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &DiscoveryResponse_Generator{} + } + if q == nil { + q = &DiscoveryResponse_Generator{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *DiscoveryResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*DiscoveryResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Empty) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Empty) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Empty) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *UserInput_TextInput) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_TextInput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_TextInput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserInput_LocalFile) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_LocalFile) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_LocalFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Error != nil { + i -= len(*m.Error) + copy(dAtA[i:], *m.Error) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.Error))) + i-- + dAtA[i] = 0x12 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserInput_Start) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_Start) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Start) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Version != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x18 + } + if m.Hydrate != nil { + size, err := m.Hydrate.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.GeneratorId) > 0 { + i -= len(m.GeneratorId) + copy(dAtA[i:], m.GeneratorId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GeneratorId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserInput_Hydrate) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_Hydrate) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Hydrate) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ResetConversation { + i-- + if m.ResetConversation { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.LastMsgId != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LastMsgId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if len(m.SavedState) > 0 { + i -= len(m.SavedState) + copy(dAtA[i:], m.SavedState) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SavedState))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserInput_Upload) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_Upload) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Upload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x1a + } + if len(m.Filename) > 0 { + i -= len(m.Filename) + copy(dAtA[i:], m.Filename) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Filename))) + i-- + dAtA[i] = 0x12 + } + if len(m.MimeType) > 0 { + i -= len(m.MimeType) + copy(dAtA[i:], m.MimeType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MimeType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserInput_Selection) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_Selection) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Selection) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UserInput_Confirmation) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_Confirmation) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Confirmation) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Affirmative { + i-- + if m.Affirmative { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UserInput_DownloadedFiles) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput_DownloadedFiles) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_DownloadedFiles) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *UserInput) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UserInput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Entry.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if len(m.FromActionId) > 0 { + i -= len(m.FromActionId) + copy(dAtA[i:], m.FromActionId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FromActionId))) + i-- + dAtA[i] = 0x1a + } + if m.FromMsgId != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FromMsgId)) + i-- + dAtA[i] = 0x10 + } + if m.MsgId != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MsgId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UserInput_Start_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Start_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Start != nil { + size, err := m.Start.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + return len(dAtA) - i, nil +} +func (m *UserInput_TextInput_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_TextInput_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.TextInput != nil { + size, err := m.TextInput.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x7a + } + return len(dAtA) - i, nil +} +func (m *UserInput_File) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_File) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.File != nil { + size, err := m.File.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *UserInput_Selection_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Selection_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Selection != nil { + size, err := m.Selection.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + return len(dAtA) - i, nil +} +func (m *UserInput_Confirmation_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_Confirmation_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Confirmation != nil { + size, err := m.Confirmation.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *UserInput_DownloadedFiles_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_DownloadedFiles_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DownloadedFiles != nil { + size, err := m.DownloadedFiles.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *UserInput_LocalFile_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UserInput_LocalFile_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.LocalFile != nil { + size, err := m.LocalFile.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_Message) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_Message) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Style) > 0 { + i -= len(m.Style) + copy(dAtA[i:], m.Style) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Style))) + i-- + dAtA[i] = 0x12 + } + if len(m.Markdown) > 0 { + i -= len(m.Markdown) + copy(dAtA[i:], m.Markdown) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Markdown))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_ImageWithText) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_ImageWithText) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_ImageWithText) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Markdown) > 0 { + i -= len(m.Markdown) + copy(dAtA[i:], m.Markdown) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Markdown))) + i-- + dAtA[i] = 0x12 + } + if len(m.ImgUrl) > 0 { + i -= len(m.ImgUrl) + copy(dAtA[i:], m.ImgUrl) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ImgUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_ListSelect) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_ListSelect) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_ListSelect) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DefaultValue) > 0 { + i -= len(m.DefaultValue) + copy(dAtA[i:], m.DefaultValue) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DefaultValue))) + i-- + dAtA[i] = 0x4a + } + if m.SelectMany { + i-- + if m.SelectMany { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.SelectType != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SelectType)) + i-- + dAtA[i] = 0x38 + } + if len(m.Instructions) > 0 { + i -= len(m.Instructions) + copy(dAtA[i:], m.Instructions) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Instructions))) + i-- + dAtA[i] = 0x32 + } + if len(m.SelectButtonLabel) > 0 { + i -= len(m.SelectButtonLabel) + copy(dAtA[i:], m.SelectButtonLabel) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SelectButtonLabel))) + i-- + dAtA[i] = 0x2a + } + if len(m.ImageUrls) > 0 { + for iNdEx := len(m.ImageUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ImageUrls[iNdEx]) + copy(dAtA[i:], m.ImageUrls[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ImageUrls[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Labels) > 0 { + for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Labels[iNdEx]) + copy(dAtA[i:], m.Labels[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Labels[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_TextInput) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_TextInput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_TextInput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DefaultValue) > 0 { + i -= len(m.DefaultValue) + copy(dAtA[i:], m.DefaultValue) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DefaultValue))) + i-- + dAtA[i] = 0x4a + } + if len(m.Prompt) > 0 { + i -= len(m.Prompt) + copy(dAtA[i:], m.Prompt) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Prompt))) + i-- + dAtA[i] = 0x42 + } + if len(m.SubmitButtonIcon) > 0 { + i -= len(m.SubmitButtonIcon) + copy(dAtA[i:], m.SubmitButtonIcon) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SubmitButtonIcon))) + i-- + dAtA[i] = 0x3a + } + if len(m.SubmitButtonLabel) > 0 { + i -= len(m.SubmitButtonLabel) + copy(dAtA[i:], m.SubmitButtonLabel) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SubmitButtonLabel))) + i-- + dAtA[i] = 0x32 + } + if len(m.ValidationErrorMessage) > 0 { + i -= len(m.ValidationErrorMessage) + copy(dAtA[i:], m.ValidationErrorMessage) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ValidationErrorMessage))) + i-- + dAtA[i] = 0x2a + } + if len(m.ValidationRegexp) > 0 { + i -= len(m.ValidationRegexp) + copy(dAtA[i:], m.ValidationRegexp) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ValidationRegexp))) + i-- + dAtA[i] = 0x22 + } + if m.MultiLine != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MultiLine)) + i-- + dAtA[i] = 0x18 + } + if len(m.Placeholder) > 0 { + i -= len(m.Placeholder) + copy(dAtA[i:], m.Placeholder) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Placeholder))) + i-- + dAtA[i] = 0x12 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_LocalFile) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_LocalFile) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_LocalFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DefaultValue) > 0 { + i -= len(m.DefaultValue) + copy(dAtA[i:], m.DefaultValue) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DefaultValue))) + i-- + dAtA[i] = 0x4a + } + if len(m.Prompt) > 0 { + i -= len(m.Prompt) + copy(dAtA[i:], m.Prompt) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Prompt))) + i-- + dAtA[i] = 0x42 + } + if len(m.SubmitButtonIcon) > 0 { + i -= len(m.SubmitButtonIcon) + copy(dAtA[i:], m.SubmitButtonIcon) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SubmitButtonIcon))) + i-- + dAtA[i] = 0x3a + } + if len(m.SubmitButtonLabel) > 0 { + i -= len(m.SubmitButtonLabel) + copy(dAtA[i:], m.SubmitButtonLabel) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SubmitButtonLabel))) + i-- + dAtA[i] = 0x32 + } + if len(m.Placeholder) > 0 { + i -= len(m.Placeholder) + copy(dAtA[i:], m.Placeholder) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Placeholder))) + i-- + dAtA[i] = 0x12 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_Loading) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_Loading) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_Loading) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0x12 + } + if m.Loading { + i-- + if m.Loading { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_DownloadFiles) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_DownloadFiles) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_DownloadFiles) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Files) > 0 { + for iNdEx := len(m.Files) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Files[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_DownloadFile) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_DownloadFile) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_DownloadFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + } + if len(m.Filename) > 0 { + i -= len(m.Filename) + copy(dAtA[i:], m.Filename) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Filename))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_Confirm) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput_Confirm) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_Confirm) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DefaultButton != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DefaultButton)) + i-- + dAtA[i] = 0x28 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.DeclineButtonLabel) > 0 { + i -= len(m.DeclineButtonLabel) + copy(dAtA[i:], m.DeclineButtonLabel) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeclineButtonLabel))) + i-- + dAtA[i] = 0x1a + } + if len(m.AcceptButtonLabel) > 0 { + i -= len(m.AcceptButtonLabel) + copy(dAtA[i:], m.AcceptButtonLabel) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AcceptButtonLabel))) + i-- + dAtA[i] = 0x12 + } + if len(m.Prompt) > 0 { + i -= len(m.Prompt) + copy(dAtA[i:], m.Prompt) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Prompt))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SystemOutput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Entry.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if len(m.StateSignature) > 0 { + i -= len(m.StateSignature) + copy(dAtA[i:], m.StateSignature) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StateSignature))) + i-- + dAtA[i] = 0x2a + } + if len(m.State) > 0 { + i -= len(m.State) + copy(dAtA[i:], m.State) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.State))) + i-- + dAtA[i] = 0x22 + } + if len(m.ActionId) > 0 { + i -= len(m.ActionId) + copy(dAtA[i:], m.ActionId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ActionId))) + i-- + dAtA[i] = 0x1a + } + if m.FromMsgId != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FromMsgId)) + i-- + dAtA[i] = 0x10 + } + if m.MsgId != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MsgId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SystemOutput_Message_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_Message_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Message != nil { + size, err := m.Message.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x7a + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_ImageWithText_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_ImageWithText_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ImageWithText != nil { + size, err := m.ImageWithText.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_ListSelect_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_ListSelect_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ListSelect != nil { + size, err := m.ListSelect.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_TextInput_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_TextInput_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.TextInput != nil { + size, err := m.TextInput.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_Loading_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_Loading_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Loading != nil { + size, err := m.Loading.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_DownloadFiles_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_DownloadFiles_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DownloadFiles != nil { + size, err := m.DownloadFiles.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_Confirm_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_Confirm_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Confirm != nil { + size, err := m.Confirm.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + return len(dAtA) - i, nil +} +func (m *SystemOutput_LocalFile_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SystemOutput_LocalFile_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.LocalFile != nil { + size, err := m.LocalFile.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + return len(dAtA) - i, nil +} +func (m *DiscoveryRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DiscoveryRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *DiscoveryRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ClientVersion != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ClientVersion)) + i-- + dAtA[i] = 0x10 + } + if len(m.SearchTerms) > 0 { + i -= len(m.SearchTerms) + copy(dAtA[i:], m.SearchTerms) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SearchTerms))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DiscoveryResponse_Generator) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DiscoveryResponse_Generator) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *DiscoveryResponse_Generator) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Group) > 0 { + i -= len(m.Group) + copy(dAtA[i:], m.Group) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Group))) + i-- + dAtA[i] = 0x32 + } + if len(m.Endpoint) > 0 { + i -= len(m.Endpoint) + copy(dAtA[i:], m.Endpoint) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Endpoint))) + i-- + dAtA[i] = 0x2a + } + if len(m.IconUrl) > 0 { + i -= len(m.IconUrl) + copy(dAtA[i:], m.IconUrl) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.IconUrl))) + i-- + dAtA[i] = 0x22 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x1a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DiscoveryResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DiscoveryResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *DiscoveryResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Generators) > 0 { + for iNdEx := len(m.Generators) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Generators[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Empty) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *UserInput_TextInput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_LocalFile) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Error != nil { + l = len(*m.Error) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_Start) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GeneratorId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Hydrate != nil { + l = m.Hydrate.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Version != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_Hydrate) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SavedState) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.LastMsgId != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LastMsgId)) + } + if m.ResetConversation { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_Upload) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MimeType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Filename) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_Selection) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Label) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_Confirmation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Affirmative { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_DownloadedFiles) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *UserInput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgId != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MsgId)) + } + if m.FromMsgId != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FromMsgId)) + } + l = len(m.FromActionId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if vtmsg, ok := m.Entry.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *UserInput_Start_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Start != nil { + l = m.Start.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *UserInput_TextInput_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TextInput != nil { + l = m.TextInput.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *UserInput_File) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.File != nil { + l = m.File.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *UserInput_Selection_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Selection != nil { + l = m.Selection.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *UserInput_Confirmation_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Confirmation != nil { + l = m.Confirmation.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *UserInput_DownloadedFiles_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DownloadedFiles != nil { + l = m.DownloadedFiles.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *UserInput_LocalFile_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LocalFile != nil { + l = m.LocalFile.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_Message) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Markdown) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Style) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_ImageWithText) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ImgUrl) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Markdown) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_ListSelect) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Labels) > 0 { + for _, s := range m.Labels { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.ImageUrls) > 0 { + for _, s := range m.ImageUrls { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.SelectButtonLabel) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Instructions) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.SelectType != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SelectType)) + } + if m.SelectMany { + n += 2 + } + l = len(m.DefaultValue) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_TextInput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Description) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Placeholder) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MultiLine != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MultiLine)) + } + l = len(m.ValidationRegexp) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.ValidationErrorMessage) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.SubmitButtonLabel) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.SubmitButtonIcon) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Prompt) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.DefaultValue) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_LocalFile) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Description) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Placeholder) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.SubmitButtonLabel) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.SubmitButtonIcon) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Prompt) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.DefaultValue) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_Loading) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Loading { + n += 2 + } + l = len(m.Label) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_DownloadFiles) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Files) > 0 { + for _, e := range m.Files { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_DownloadFile) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Filename) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_Confirm) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prompt) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.AcceptButtonLabel) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.DeclineButtonLabel) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DefaultButton != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.DefaultButton)) + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgId != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MsgId)) + } + if m.FromMsgId != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FromMsgId)) + } + l = len(m.ActionId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.State) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.StateSignature) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if vtmsg, ok := m.Entry.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *SystemOutput_Message_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Message != nil { + l = m.Message.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_ImageWithText_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ImageWithText != nil { + l = m.ImageWithText.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_ListSelect_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ListSelect != nil { + l = m.ListSelect.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_TextInput_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TextInput != nil { + l = m.TextInput.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_Loading_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Loading != nil { + l = m.Loading.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_DownloadFiles_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DownloadFiles != nil { + l = m.DownloadFiles.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_Confirm_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Confirm != nil { + l = m.Confirm.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *SystemOutput_LocalFile_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LocalFile != nil { + l = m.LocalFile.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *DiscoveryRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SearchTerms) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ClientVersion != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ClientVersion)) + } + n += len(m.unknownFields) + return n +} + +func (m *DiscoveryResponse_Generator) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.IconUrl) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Endpoint) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Group) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *DiscoveryResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Generators) > 0 { + for _, e := range m.Generators { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Empty) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Empty: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Empty: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_TextInput) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_TextInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_TextInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_LocalFile) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_LocalFile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_LocalFile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Error = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_Start) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_Start: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_Start: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GeneratorId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GeneratorId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hydrate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hydrate == nil { + m.Hydrate = &UserInput_Hydrate{} + } + if err := m.Hydrate.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_Hydrate) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_Hydrate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_Hydrate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SavedState", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SavedState = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastMsgId", wireType) + } + m.LastMsgId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastMsgId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResetConversation", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ResetConversation = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_Upload) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_Upload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_Upload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MimeType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MimeType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filename", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filename = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = append(m.Content[:0], dAtA[iNdEx:postIndex]...) + if m.Content == nil { + m.Content = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_Selection) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_Selection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_Selection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_Confirmation) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_Confirmation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_Confirmation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Affirmative", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Affirmative = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput_DownloadedFiles) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput_DownloadedFiles: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput_DownloadedFiles: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserInput) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UserInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgId", wireType) + } + m.MsgId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MsgId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FromMsgId", wireType) + } + m.FromMsgId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FromMsgId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromActionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FromActionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*UserInput_Start_); ok { + if err := oneof.Start.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UserInput_Start{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &UserInput_Start_{Start: v} + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TextInput", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*UserInput_TextInput_); ok { + if err := oneof.TextInput.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UserInput_TextInput{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &UserInput_TextInput_{TextInput: v} + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*UserInput_File); ok { + if err := oneof.File.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UserInput_Upload{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &UserInput_File{File: v} + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*UserInput_Selection_); ok { + if err := oneof.Selection.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UserInput_Selection{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &UserInput_Selection_{Selection: v} + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Confirmation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*UserInput_Confirmation_); ok { + if err := oneof.Confirmation.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UserInput_Confirmation{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &UserInput_Confirmation_{Confirmation: v} + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadedFiles", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*UserInput_DownloadedFiles_); ok { + if err := oneof.DownloadedFiles.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UserInput_DownloadedFiles{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &UserInput_DownloadedFiles_{DownloadedFiles: v} + } + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalFile", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*UserInput_LocalFile_); ok { + if err := oneof.LocalFile.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &UserInput_LocalFile{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &UserInput_LocalFile_{LocalFile: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_Message) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_Message: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_Message: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Markdown", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Markdown = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Style", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Style = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_ImageWithText) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_ImageWithText: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_ImageWithText: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImgUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImgUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Markdown", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Markdown = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_ListSelect) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_ListSelect: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_ListSelect: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Labels = append(m.Labels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImageUrls = append(m.ImageUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SelectButtonLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SelectButtonLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Instructions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Instructions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SelectType", wireType) + } + m.SelectType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SelectType |= SystemOutput_ListSelect_SelectType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SelectMany", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SelectMany = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_TextInput) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_TextInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_TextInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Placeholder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Placeholder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MultiLine", wireType) + } + m.MultiLine = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MultiLine |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidationRegexp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidationRegexp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidationErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidationErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmitButtonLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubmitButtonLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmitButtonIcon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubmitButtonIcon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prompt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prompt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_LocalFile) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_LocalFile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_LocalFile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Placeholder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Placeholder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmitButtonLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubmitButtonLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmitButtonIcon", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubmitButtonIcon = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prompt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prompt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_Loading) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_Loading: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_Loading: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Loading", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Loading = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_DownloadFiles) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_DownloadFiles: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_DownloadFiles: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Files = append(m.Files, &SystemOutput_DownloadFile{}) + if err := m.Files[len(m.Files)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_DownloadFile) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_DownloadFile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_DownloadFile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filename", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filename = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = append(m.Content[:0], dAtA[iNdEx:postIndex]...) + if m.Content == nil { + m.Content = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput_Confirm) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput_Confirm: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput_Confirm: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prompt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prompt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AcceptButtonLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AcceptButtonLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeclineButtonLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeclineButtonLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultButton", wireType) + } + m.DefaultButton = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DefaultButton |= SystemOutput_Confirm_Button(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SystemOutput) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SystemOutput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SystemOutput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgId", wireType) + } + m.MsgId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MsgId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FromMsgId", wireType) + } + m.FromMsgId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FromMsgId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ActionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.State = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateSignature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateSignature = append(m.StateSignature[:0], dAtA[iNdEx:postIndex]...) + if m.StateSignature == nil { + m.StateSignature = []byte{} + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_Message_); ok { + if err := oneof.Message.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_Message{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_Message_{Message: v} + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageWithText", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_ImageWithText_); ok { + if err := oneof.ImageWithText.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_ImageWithText{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_ImageWithText_{ImageWithText: v} + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListSelect", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_ListSelect_); ok { + if err := oneof.ListSelect.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_ListSelect{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_ListSelect_{ListSelect: v} + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TextInput", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_TextInput_); ok { + if err := oneof.TextInput.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_TextInput{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_TextInput_{TextInput: v} + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Loading", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_Loading_); ok { + if err := oneof.Loading.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_Loading{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_Loading_{Loading: v} + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadFiles", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_DownloadFiles_); ok { + if err := oneof.DownloadFiles.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_DownloadFiles{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_DownloadFiles_{DownloadFiles: v} + } + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Confirm", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_Confirm_); ok { + if err := oneof.Confirm.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_Confirm{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_Confirm_{Confirm: v} + } + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalFile", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Entry.(*SystemOutput_LocalFile_); ok { + if err := oneof.LocalFile.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SystemOutput_LocalFile{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Entry = &SystemOutput_LocalFile_{LocalFile: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DiscoveryRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: DiscoveryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DiscoveryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SearchTerms", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SearchTerms = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientVersion", wireType) + } + m.ClientVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClientVersion |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DiscoveryResponse_Generator) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: DiscoveryResponse_Generator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DiscoveryResponse_Generator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IconUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IconUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Group = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DiscoveryResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: DiscoveryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DiscoveryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Generators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Generators = append(m.Generators, &DiscoveryResponse_Generator{}) + if err := m.Generators[len(m.Generators)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/index/v1/keys_vtproto.pb.go b/pb/sf/substreams/index/v1/keys_vtproto.pb.go new file mode 100644 index 000000000..3a6e0be9d --- /dev/null +++ b/pb/sf/substreams/index/v1/keys_vtproto.pb.go @@ -0,0 +1,208 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/index/v1/keys.proto + +package pbsubstreams + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *Keys) CloneVT() *Keys { + if m == nil { + return (*Keys)(nil) + } + r := new(Keys) + if rhs := m.Keys; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Keys = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Keys) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Keys) EqualVT(that *Keys) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Keys) != len(that.Keys) { + return false + } + for i, vx := range this.Keys { + vy := that.Keys[i] + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Keys) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Keys) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Keys) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Keys) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Keys) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Keys) > 0 { + for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Keys[iNdEx]) + copy(dAtA[i:], m.Keys[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Keys[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Keys) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Keys) > 0 { + for _, s := range m.Keys { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Keys) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Keys: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Keys: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keys = append(m.Keys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/intern/v2/deltas_vtproto.pb.go b/pb/sf/substreams/intern/v2/deltas_vtproto.pb.go new file mode 100644 index 000000000..50460d395 --- /dev/null +++ b/pb/sf/substreams/intern/v2/deltas_vtproto.pb.go @@ -0,0 +1,1061 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/intern/v2/deltas.proto + +package pbssinternal + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" + v1 "github.com/streamingfast/substreams/pb/sf/substreams/v1" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" +) + +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) +) + +func (m *ModuleOutput) CloneVT() *ModuleOutput { + if m == nil { + return (*ModuleOutput)(nil) + } + r := new(ModuleOutput) + r.ModuleName = m.ModuleName + r.DebugLogsTruncated = m.DebugLogsTruncated + r.Cached = m.Cached + if m.Data != nil { + r.Data = m.Data.(interface{ CloneVT() isModuleOutput_Data }).CloneVT() + } + if rhs := m.Logs; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Logs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ModuleOutput) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ModuleOutput_MapOutput) CloneVT() isModuleOutput_Data { + if m == nil { + return (*ModuleOutput_MapOutput)(nil) + } + r := new(ModuleOutput_MapOutput) + r.MapOutput = (*anypb.Any)((*anypb1.Any)(m.MapOutput).CloneVT()) + return r +} + +func (m *ModuleOutput_StoreDeltas) CloneVT() isModuleOutput_Data { + if m == nil { + return (*ModuleOutput_StoreDeltas)(nil) + } + r := new(ModuleOutput_StoreDeltas) + r.StoreDeltas = m.StoreDeltas.CloneVT() + return r +} + +func (m *Operations) CloneVT() *Operations { + if m == nil { + return (*Operations)(nil) + } + r := new(Operations) + if rhs := m.Operations; rhs != nil { + tmpContainer := make([]*Operation, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Operations = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Operations) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Operation) CloneVT() *Operation { + if m == nil { + return (*Operation)(nil) + } + r := new(Operation) + r.Type = m.Type + r.Ord = m.Ord + r.Key = m.Key + if rhs := m.Value; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Value = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Operation) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *ModuleOutput) EqualVT(that *ModuleOutput) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Data == nil && that.Data != nil { + return false + } else if this.Data != nil { + if that.Data == nil { + return false + } + if !this.Data.(interface { + EqualVT(isModuleOutput_Data) bool + }).EqualVT(that.Data) { + return false + } + } + if this.ModuleName != that.ModuleName { + return false + } + if len(this.Logs) != len(that.Logs) { + return false + } + for i, vx := range this.Logs { + vy := that.Logs[i] + if vx != vy { + return false + } + } + if this.DebugLogsTruncated != that.DebugLogsTruncated { + return false + } + if this.Cached != that.Cached { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ModuleOutput) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ModuleOutput) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ModuleOutput_MapOutput) EqualVT(thatIface isModuleOutput_Data) bool { + that, ok := thatIface.(*ModuleOutput_MapOutput) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.MapOutput, that.MapOutput; p != q { + if p == nil { + p = &anypb.Any{} + } + if q == nil { + q = &anypb.Any{} + } + if !(*anypb1.Any)(p).EqualVT((*anypb1.Any)(q)) { + return false + } + } + return true +} + +func (this *ModuleOutput_StoreDeltas) EqualVT(thatIface isModuleOutput_Data) bool { + that, ok := thatIface.(*ModuleOutput_StoreDeltas) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.StoreDeltas, that.StoreDeltas; p != q { + if p == nil { + p = &v1.StoreDeltas{} + } + if q == nil { + q = &v1.StoreDeltas{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Operations) EqualVT(that *Operations) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Operations) != len(that.Operations) { + return false + } + for i, vx := range this.Operations { + vy := that.Operations[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Operation{} + } + if q == nil { + q = &Operation{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Operations) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Operations) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Operation) EqualVT(that *Operation) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if this.Ord != that.Ord { + return false + } + if this.Key != that.Key { + return false + } + if string(this.Value) != string(that.Value) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Operation) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Operation) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *ModuleOutput) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModuleOutput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModuleOutput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Data.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if m.Cached { + i-- + if m.Cached { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.DebugLogsTruncated { + i-- + if m.DebugLogsTruncated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Logs[iNdEx]) + copy(dAtA[i:], m.Logs[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Logs[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ModuleName) > 0 { + i -= len(m.ModuleName) + copy(dAtA[i:], m.ModuleName) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ModuleName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ModuleOutput_MapOutput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModuleOutput_MapOutput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.MapOutput != nil { + size, err := (*anypb1.Any)(m.MapOutput).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *ModuleOutput_StoreDeltas) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModuleOutput_StoreDeltas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.StoreDeltas != nil { + size, err := m.StoreDeltas.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Operations) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operations) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Operations) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Operations) > 0 { + for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Operations[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Operation) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Operation) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Operation) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if m.Ord != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Ord)) + i-- + dAtA[i] = 0x10 + } + if m.Type != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ModuleOutput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ModuleName) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if vtmsg, ok := m.Data.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if len(m.Logs) > 0 { + for _, s := range m.Logs { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.DebugLogsTruncated { + n += 2 + } + if m.Cached { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ModuleOutput_MapOutput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MapOutput != nil { + l = (*anypb1.Any)(m.MapOutput).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *ModuleOutput_StoreDeltas) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StoreDeltas != nil { + l = m.StoreDeltas.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Operations) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Operations) > 0 { + for _, e := range m.Operations { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Operation) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) + } + if m.Ord != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Ord)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ModuleOutput) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ModuleOutput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleOutput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MapOutput", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Data.(*ModuleOutput_MapOutput); ok { + if err := (*anypb1.Any)(oneof.MapOutput).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &anypb.Any{} + if err := (*anypb1.Any)(v).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &ModuleOutput_MapOutput{MapOutput: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreDeltas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Data.(*ModuleOutput_StoreDeltas); ok { + if err := oneof.StoreDeltas.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &v1.StoreDeltas{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &ModuleOutput_StoreDeltas{StoreDeltas: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugLogsTruncated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DebugLogsTruncated = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cached", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Cached = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operations) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Operations: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Operations: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operations = append(m.Operations, &Operation{}) + if err := m.Operations[len(m.Operations)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Operation) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Operation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Operation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= Operation_Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ord", wireType) + } + m.Ord = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ord |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/intern/v2/service_vtproto.pb.go b/pb/sf/substreams/intern/v2/service_vtproto.pb.go new file mode 100644 index 000000000..00ee2e9aa --- /dev/null +++ b/pb/sf/substreams/intern/v2/service_vtproto.pb.go @@ -0,0 +1,3671 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/intern/v2/service.proto + +package pbssinternal + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" + v1 "github.com/streamingfast/substreams/pb/sf/substreams/v1" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" +) + +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) +) + +func (m *ProcessRangeRequest) CloneVT() *ProcessRangeRequest { + if m == nil { + return (*ProcessRangeRequest)(nil) + } + r := new(ProcessRangeRequest) + r.StopBlockNum = m.StopBlockNum + r.OutputModule = m.OutputModule + r.Modules = m.Modules.CloneVT() + r.Stage = m.Stage + r.MeteringConfig = m.MeteringConfig + r.FirstStreamableBlock = m.FirstStreamableBlock + r.MergedBlocksStore = m.MergedBlocksStore + r.StateStore = m.StateStore + r.StateStoreDefaultTag = m.StateStoreDefaultTag + r.SegmentSize = m.SegmentSize + r.BlockType = m.BlockType + r.SegmentNumber = m.SegmentNumber + r.ProductionMode = m.ProductionMode + r.StreamOutput = m.StreamOutput + r.EthCallFallbackToLatestDuration = m.EthCallFallbackToLatestDuration + r.EthCallFallbackToNumberDuration = m.EthCallFallbackToNumberDuration + if rhs := m.WasmExtensionConfigs; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.WasmExtensionConfigs = tmpContainer + } + if rhs := m.FoundationalStoreEndpoints; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.FoundationalStoreEndpoints = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ProcessRangeRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ProcessRangeResponse) CloneVT() *ProcessRangeResponse { + if m == nil { + return (*ProcessRangeResponse)(nil) + } + r := new(ProcessRangeResponse) + if m.Type != nil { + r.Type = m.Type.(interface { + CloneVT() isProcessRangeResponse_Type + }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ProcessRangeResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ProcessRangeResponse_Failed) CloneVT() isProcessRangeResponse_Type { + if m == nil { + return (*ProcessRangeResponse_Failed)(nil) + } + r := new(ProcessRangeResponse_Failed) + r.Failed = m.Failed.CloneVT() + return r +} + +func (m *ProcessRangeResponse_Completed) CloneVT() isProcessRangeResponse_Type { + if m == nil { + return (*ProcessRangeResponse_Completed)(nil) + } + r := new(ProcessRangeResponse_Completed) + r.Completed = m.Completed.CloneVT() + return r +} + +func (m *ProcessRangeResponse_Update) CloneVT() isProcessRangeResponse_Type { + if m == nil { + return (*ProcessRangeResponse_Update)(nil) + } + r := new(ProcessRangeResponse_Update) + r.Update = m.Update.CloneVT() + return r +} + +func (m *ProcessRangeResponse_BlockScopedData) CloneVT() isProcessRangeResponse_Type { + if m == nil { + return (*ProcessRangeResponse_BlockScopedData)(nil) + } + r := new(ProcessRangeResponse_BlockScopedData) + r.BlockScopedData = m.BlockScopedData.CloneVT() + return r +} + +func (m *BlockScopedData) CloneVT() *BlockScopedData { + if m == nil { + return (*BlockScopedData)(nil) + } + r := new(BlockScopedData) + r.Output = (*anypb.Any)((*anypb1.Any)(m.Output).CloneVT()) + r.Clock = m.Clock.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockScopedData) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Update) CloneVT() *Update { + if m == nil { + return (*Update)(nil) + } + r := new(Update) + r.DurationMs = m.DurationMs + r.ProgressBlocks = m.ProgressBlocks + r.TotalBytesRead = m.TotalBytesRead + r.TotalBytesWritten = m.TotalBytesWritten + if rhs := m.ModulesStats; rhs != nil { + tmpContainer := make([]*ModuleStats, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.ModulesStats = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Update) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ModuleStats) CloneVT() *ModuleStats { + if m == nil { + return (*ModuleStats)(nil) + } + r := new(ModuleStats) + r.Name = m.Name + r.ProcessingTimeMs = m.ProcessingTimeMs + r.StoreOperationTimeMs = m.StoreOperationTimeMs + r.StoreReadCount = m.StoreReadCount + r.StoreWriteCount = m.StoreWriteCount + r.StoreDeleteprefixCount = m.StoreDeleteprefixCount + r.StoreSizeBytes = m.StoreSizeBytes + if rhs := m.ExternalCallMetrics; rhs != nil { + tmpContainer := make([]*ExternalCallMetric, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.ExternalCallMetrics = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ModuleStats) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ExternalCallMetric) CloneVT() *ExternalCallMetric { + if m == nil { + return (*ExternalCallMetric)(nil) + } + r := new(ExternalCallMetric) + r.Name = m.Name + r.Count = m.Count + r.TimeMs = m.TimeMs + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ExternalCallMetric) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Completed) CloneVT() *Completed { + if m == nil { + return (*Completed)(nil) + } + r := new(Completed) + r.ProcessedBlocks = m.ProcessedBlocks + r.StreamingMode = m.StreamingMode + if rhs := m.AllProcessedRanges; rhs != nil { + tmpContainer := make([]*BlockRange, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.AllProcessedRanges = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Completed) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Failed) CloneVT() *Failed { + if m == nil { + return (*Failed)(nil) + } + r := new(Failed) + r.Reason = m.Reason + r.LogsTruncated = m.LogsTruncated + if rhs := m.Logs; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Logs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Failed) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BlockRange) CloneVT() *BlockRange { + if m == nil { + return (*BlockRange)(nil) + } + r := new(BlockRange) + r.StartBlock = m.StartBlock + r.EndBlock = m.EndBlock + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockRange) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *ProcessRangeRequest) EqualVT(that *ProcessRangeRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StopBlockNum != that.StopBlockNum { + return false + } + if this.OutputModule != that.OutputModule { + return false + } + if !this.Modules.EqualVT(that.Modules) { + return false + } + if this.Stage != that.Stage { + return false + } + if this.MeteringConfig != that.MeteringConfig { + return false + } + if this.FirstStreamableBlock != that.FirstStreamableBlock { + return false + } + if len(this.WasmExtensionConfigs) != len(that.WasmExtensionConfigs) { + return false + } + for i, vx := range this.WasmExtensionConfigs { + vy, ok := that.WasmExtensionConfigs[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + if this.MergedBlocksStore != that.MergedBlocksStore { + return false + } + if this.StateStore != that.StateStore { + return false + } + if this.StateStoreDefaultTag != that.StateStoreDefaultTag { + return false + } + if this.SegmentSize != that.SegmentSize { + return false + } + if this.BlockType != that.BlockType { + return false + } + if this.SegmentNumber != that.SegmentNumber { + return false + } + if this.ProductionMode != that.ProductionMode { + return false + } + if this.StreamOutput != that.StreamOutput { + return false + } + if len(this.FoundationalStoreEndpoints) != len(that.FoundationalStoreEndpoints) { + return false + } + for i, vx := range this.FoundationalStoreEndpoints { + vy, ok := that.FoundationalStoreEndpoints[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + if this.EthCallFallbackToLatestDuration != that.EthCallFallbackToLatestDuration { + return false + } + if this.EthCallFallbackToNumberDuration != that.EthCallFallbackToNumberDuration { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ProcessRangeRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ProcessRangeRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ProcessRangeResponse) EqualVT(that *ProcessRangeResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type == nil && that.Type != nil { + return false + } else if this.Type != nil { + if that.Type == nil { + return false + } + if !this.Type.(interface { + EqualVT(isProcessRangeResponse_Type) bool + }).EqualVT(that.Type) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ProcessRangeResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ProcessRangeResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ProcessRangeResponse_Failed) EqualVT(thatIface isProcessRangeResponse_Type) bool { + that, ok := thatIface.(*ProcessRangeResponse_Failed) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Failed, that.Failed; p != q { + if p == nil { + p = &Failed{} + } + if q == nil { + q = &Failed{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *ProcessRangeResponse_Completed) EqualVT(thatIface isProcessRangeResponse_Type) bool { + that, ok := thatIface.(*ProcessRangeResponse_Completed) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Completed, that.Completed; p != q { + if p == nil { + p = &Completed{} + } + if q == nil { + q = &Completed{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *ProcessRangeResponse_Update) EqualVT(thatIface isProcessRangeResponse_Type) bool { + that, ok := thatIface.(*ProcessRangeResponse_Update) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Update, that.Update; p != q { + if p == nil { + p = &Update{} + } + if q == nil { + q = &Update{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *ProcessRangeResponse_BlockScopedData) EqualVT(thatIface isProcessRangeResponse_Type) bool { + that, ok := thatIface.(*ProcessRangeResponse_BlockScopedData) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.BlockScopedData, that.BlockScopedData; p != q { + if p == nil { + p = &BlockScopedData{} + } + if q == nil { + q = &BlockScopedData{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *BlockScopedData) EqualVT(that *BlockScopedData) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !(*anypb1.Any)(this.Output).EqualVT((*anypb1.Any)(that.Output)) { + return false + } + if !this.Clock.EqualVT(that.Clock) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockScopedData) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockScopedData) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Update) EqualVT(that *Update) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.DurationMs != that.DurationMs { + return false + } + if this.ProgressBlocks != that.ProgressBlocks { + return false + } + if this.TotalBytesRead != that.TotalBytesRead { + return false + } + if this.TotalBytesWritten != that.TotalBytesWritten { + return false + } + if len(this.ModulesStats) != len(that.ModulesStats) { + return false + } + for i, vx := range this.ModulesStats { + vy := that.ModulesStats[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ModuleStats{} + } + if q == nil { + q = &ModuleStats{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Update) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Update) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ModuleStats) EqualVT(that *ModuleStats) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.ProcessingTimeMs != that.ProcessingTimeMs { + return false + } + if this.StoreOperationTimeMs != that.StoreOperationTimeMs { + return false + } + if this.StoreReadCount != that.StoreReadCount { + return false + } + if len(this.ExternalCallMetrics) != len(that.ExternalCallMetrics) { + return false + } + for i, vx := range this.ExternalCallMetrics { + vy := that.ExternalCallMetrics[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ExternalCallMetric{} + } + if q == nil { + q = &ExternalCallMetric{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.StoreWriteCount != that.StoreWriteCount { + return false + } + if this.StoreDeleteprefixCount != that.StoreDeleteprefixCount { + return false + } + if this.StoreSizeBytes != that.StoreSizeBytes { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ModuleStats) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ModuleStats) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ExternalCallMetric) EqualVT(that *ExternalCallMetric) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Count != that.Count { + return false + } + if this.TimeMs != that.TimeMs { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ExternalCallMetric) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ExternalCallMetric) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Completed) EqualVT(that *Completed) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.AllProcessedRanges) != len(that.AllProcessedRanges) { + return false + } + for i, vx := range this.AllProcessedRanges { + vy := that.AllProcessedRanges[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &BlockRange{} + } + if q == nil { + q = &BlockRange{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.ProcessedBlocks != that.ProcessedBlocks { + return false + } + if this.StreamingMode != that.StreamingMode { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Completed) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Completed) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Failed) EqualVT(that *Failed) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Reason != that.Reason { + return false + } + if len(this.Logs) != len(that.Logs) { + return false + } + for i, vx := range this.Logs { + vy := that.Logs[i] + if vx != vy { + return false + } + } + if this.LogsTruncated != that.LogsTruncated { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Failed) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Failed) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *BlockRange) EqualVT(that *BlockRange) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StartBlock != that.StartBlock { + return false + } + if this.EndBlock != that.EndBlock { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockRange) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockRange) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *ProcessRangeRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessRangeRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ProcessRangeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.EthCallFallbackToNumberDuration != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EthCallFallbackToNumberDuration)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if m.EthCallFallbackToLatestDuration != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EthCallFallbackToLatestDuration)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if len(m.FoundationalStoreEndpoints) > 0 { + for k := range m.FoundationalStoreEndpoints { + v := m.FoundationalStoreEndpoints[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + } + if m.StreamOutput { + i-- + if m.StreamOutput { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.ProductionMode { + i-- + if m.ProductionMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.SegmentNumber != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SegmentNumber)) + i-- + dAtA[i] = 0x78 + } + if len(m.BlockType) > 0 { + i -= len(m.BlockType) + copy(dAtA[i:], m.BlockType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BlockType))) + i-- + dAtA[i] = 0x72 + } + if m.SegmentSize != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SegmentSize)) + i-- + dAtA[i] = 0x68 + } + if len(m.StateStoreDefaultTag) > 0 { + i -= len(m.StateStoreDefaultTag) + copy(dAtA[i:], m.StateStoreDefaultTag) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StateStoreDefaultTag))) + i-- + dAtA[i] = 0x62 + } + if len(m.StateStore) > 0 { + i -= len(m.StateStore) + copy(dAtA[i:], m.StateStore) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StateStore))) + i-- + dAtA[i] = 0x5a + } + if len(m.MergedBlocksStore) > 0 { + i -= len(m.MergedBlocksStore) + copy(dAtA[i:], m.MergedBlocksStore) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MergedBlocksStore))) + i-- + dAtA[i] = 0x52 + } + if len(m.WasmExtensionConfigs) > 0 { + for k := range m.WasmExtensionConfigs { + v := m.WasmExtensionConfigs[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if m.FirstStreamableBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FirstStreamableBlock)) + i-- + dAtA[i] = 0x38 + } + if len(m.MeteringConfig) > 0 { + i -= len(m.MeteringConfig) + copy(dAtA[i:], m.MeteringConfig) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.MeteringConfig))) + i-- + dAtA[i] = 0x32 + } + if m.Stage != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Stage)) + i-- + dAtA[i] = 0x28 + } + if m.Modules != nil { + size, err := m.Modules.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.OutputModule) > 0 { + i -= len(m.OutputModule) + copy(dAtA[i:], m.OutputModule) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OutputModule))) + i-- + dAtA[i] = 0x1a + } + if m.StopBlockNum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StopBlockNum)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *ProcessRangeResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessRangeResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ProcessRangeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Type.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *ProcessRangeResponse_Failed) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ProcessRangeResponse_Failed) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Failed != nil { + size, err := m.Failed.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *ProcessRangeResponse_Completed) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ProcessRangeResponse_Completed) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Completed != nil { + size, err := m.Completed.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *ProcessRangeResponse_Update) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ProcessRangeResponse_Update) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Update != nil { + size, err := m.Update.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *ProcessRangeResponse_BlockScopedData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ProcessRangeResponse_BlockScopedData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BlockScopedData != nil { + size, err := m.BlockScopedData.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *BlockScopedData) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockScopedData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockScopedData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Clock != nil { + size, err := m.Clock.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Output != nil { + size, err := (*anypb1.Any)(m.Output).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Update) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Update) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Update) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.ModulesStats) > 0 { + for iNdEx := len(m.ModulesStats) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ModulesStats[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + } + if m.TotalBytesWritten != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalBytesWritten)) + i-- + dAtA[i] = 0x20 + } + if m.TotalBytesRead != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalBytesRead)) + i-- + dAtA[i] = 0x18 + } + if m.ProgressBlocks != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProgressBlocks)) + i-- + dAtA[i] = 0x10 + } + if m.DurationMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DurationMs)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ModuleStats) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModuleStats) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModuleStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.StoreSizeBytes != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreSizeBytes)) + i-- + dAtA[i] = 0x60 + } + if m.StoreDeleteprefixCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreDeleteprefixCount)) + i-- + dAtA[i] = 0x58 + } + if m.StoreWriteCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreWriteCount)) + i-- + dAtA[i] = 0x50 + } + if len(m.ExternalCallMetrics) > 0 { + for iNdEx := len(m.ExternalCallMetrics) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ExternalCallMetrics[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + } + if m.StoreReadCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreReadCount)) + i-- + dAtA[i] = 0x20 + } + if m.StoreOperationTimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreOperationTimeMs)) + i-- + dAtA[i] = 0x18 + } + if m.ProcessingTimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProcessingTimeMs)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExternalCallMetric) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalCallMetric) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExternalCallMetric) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.TimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TimeMs)) + i-- + dAtA[i] = 0x18 + } + if m.Count != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Completed) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Completed) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Completed) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.StreamingMode { + i-- + if m.StreamingMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.ProcessedBlocks != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProcessedBlocks)) + i-- + dAtA[i] = 0x18 + } + if len(m.AllProcessedRanges) > 0 { + for iNdEx := len(m.AllProcessedRanges) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.AllProcessedRanges[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Failed) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Failed) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Failed) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.LogsTruncated { + i-- + if m.LogsTruncated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Logs[iNdEx]) + copy(dAtA[i:], m.Logs[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Logs[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockRange) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockRange) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockRange) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.EndBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EndBlock)) + i-- + dAtA[i] = 0x18 + } + if m.StartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartBlock)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *ProcessRangeRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StopBlockNum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StopBlockNum)) + } + l = len(m.OutputModule) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Modules != nil { + l = m.Modules.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Stage != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Stage)) + } + l = len(m.MeteringConfig) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FirstStreamableBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FirstStreamableBlock)) + } + if len(m.WasmExtensionConfigs) > 0 { + for k, v := range m.WasmExtensionConfigs { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + l = len(m.MergedBlocksStore) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.StateStore) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.StateStoreDefaultTag) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.SegmentSize != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SegmentSize)) + } + l = len(m.BlockType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.SegmentNumber != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SegmentNumber)) + } + if m.ProductionMode { + n += 3 + } + if m.StreamOutput { + n += 3 + } + if len(m.FoundationalStoreEndpoints) > 0 { + for k, v := range m.FoundationalStoreEndpoints { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 2 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if m.EthCallFallbackToLatestDuration != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.EthCallFallbackToLatestDuration)) + } + if m.EthCallFallbackToNumberDuration != 0 { + n += 2 + protohelpers.SizeOfVarint(uint64(m.EthCallFallbackToNumberDuration)) + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessRangeResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Type.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessRangeResponse_Failed) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Failed != nil { + l = m.Failed.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *ProcessRangeResponse_Completed) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Completed != nil { + l = m.Completed.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *ProcessRangeResponse_Update) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Update != nil { + l = m.Update.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *ProcessRangeResponse_BlockScopedData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockScopedData != nil { + l = m.BlockScopedData.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *BlockScopedData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Output != nil { + l = (*anypb1.Any)(m.Output).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Clock != nil { + l = m.Clock.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Update) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DurationMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.DurationMs)) + } + if m.ProgressBlocks != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProgressBlocks)) + } + if m.TotalBytesRead != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalBytesRead)) + } + if m.TotalBytesWritten != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalBytesWritten)) + } + if len(m.ModulesStats) > 0 { + for _, e := range m.ModulesStats { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *ModuleStats) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ProcessingTimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProcessingTimeMs)) + } + if m.StoreOperationTimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreOperationTimeMs)) + } + if m.StoreReadCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreReadCount)) + } + if len(m.ExternalCallMetrics) > 0 { + for _, e := range m.ExternalCallMetrics { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.StoreWriteCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreWriteCount)) + } + if m.StoreDeleteprefixCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreDeleteprefixCount)) + } + if m.StoreSizeBytes != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreSizeBytes)) + } + n += len(m.unknownFields) + return n +} + +func (m *ExternalCallMetric) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Count != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Count)) + } + if m.TimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TimeMs)) + } + n += len(m.unknownFields) + return n +} + +func (m *Completed) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllProcessedRanges) > 0 { + for _, e := range m.AllProcessedRanges { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.ProcessedBlocks != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProcessedBlocks)) + } + if m.StreamingMode { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *Failed) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Reason) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Logs) > 0 { + for _, s := range m.Logs { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.LogsTruncated { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *BlockRange) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartBlock)) + } + if m.EndBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndBlock)) + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessRangeRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ProcessRangeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StopBlockNum", wireType) + } + m.StopBlockNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StopBlockNum |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputModule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutputModule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Modules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Modules == nil { + m.Modules = &v1.Modules{} + } + if err := m.Modules.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Stage", wireType) + } + m.Stage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Stage |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MeteringConfig", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MeteringConfig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FirstStreamableBlock", wireType) + } + m.FirstStreamableBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FirstStreamableBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WasmExtensionConfigs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WasmExtensionConfigs == nil { + m.WasmExtensionConfigs = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.WasmExtensionConfigs[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MergedBlocksStore", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MergedBlocksStore = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateStore", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateStore = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateStoreDefaultTag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateStoreDefaultTag = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SegmentSize", wireType) + } + m.SegmentSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SegmentSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SegmentNumber", wireType) + } + m.SegmentNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SegmentNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProductionMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ProductionMode = bool(v != 0) + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamOutput", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StreamOutput = bool(v != 0) + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FoundationalStoreEndpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FoundationalStoreEndpoints == nil { + m.FoundationalStoreEndpoints = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.FoundationalStoreEndpoints[mapkey] = mapvalue + iNdEx = postIndex + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EthCallFallbackToLatestDuration", wireType) + } + m.EthCallFallbackToLatestDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EthCallFallbackToLatestDuration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EthCallFallbackToNumberDuration", wireType) + } + m.EthCallFallbackToNumberDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EthCallFallbackToNumberDuration |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProcessRangeResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ProcessRangeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Type.(*ProcessRangeResponse_Failed); ok { + if err := oneof.Failed.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Failed{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Type = &ProcessRangeResponse_Failed{Failed: v} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Completed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Type.(*ProcessRangeResponse_Completed); ok { + if err := oneof.Completed.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Completed{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Type = &ProcessRangeResponse_Completed{Completed: v} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Type.(*ProcessRangeResponse_Update); ok { + if err := oneof.Update.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Update{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Type = &ProcessRangeResponse_Update{Update: v} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockScopedData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Type.(*ProcessRangeResponse_BlockScopedData); ok { + if err := oneof.BlockScopedData.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &BlockScopedData{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Type = &ProcessRangeResponse_BlockScopedData{BlockScopedData: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockScopedData) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockScopedData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockScopedData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output == nil { + m.Output = &anypb.Any{} + } + if err := (*anypb1.Any)(m.Output).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Clock == nil { + m.Clock = &v1.Clock{} + } + if err := m.Clock.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Update) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Update: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Update: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationMs", wireType) + } + m.DurationMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DurationMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProgressBlocks", wireType) + } + m.ProgressBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProgressBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBytesRead", wireType) + } + m.TotalBytesRead = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalBytesRead |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBytesWritten", wireType) + } + m.TotalBytesWritten = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalBytesWritten |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModulesStats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModulesStats = append(m.ModulesStats, &ModuleStats{}) + if err := m.ModulesStats[len(m.ModulesStats)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleStats) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ModuleStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessingTimeMs", wireType) + } + m.ProcessingTimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProcessingTimeMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreOperationTimeMs", wireType) + } + m.StoreOperationTimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreOperationTimeMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreReadCount", wireType) + } + m.StoreReadCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreReadCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalCallMetrics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExternalCallMetrics = append(m.ExternalCallMetrics, &ExternalCallMetric{}) + if err := m.ExternalCallMetrics[len(m.ExternalCallMetrics)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreWriteCount", wireType) + } + m.StoreWriteCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreWriteCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreDeleteprefixCount", wireType) + } + m.StoreDeleteprefixCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreDeleteprefixCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreSizeBytes", wireType) + } + m.StoreSizeBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreSizeBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExternalCallMetric) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ExternalCallMetric: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExternalCallMetric: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeMs", wireType) + } + m.TimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Completed) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Completed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Completed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllProcessedRanges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllProcessedRanges = append(m.AllProcessedRanges, &BlockRange{}) + if err := m.AllProcessedRanges[len(m.AllProcessedRanges)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessedBlocks", wireType) + } + m.ProcessedBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProcessedBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamingMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StreamingMode = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Failed) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Failed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LogsTruncated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LogsTruncated = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockRange) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBlock", wireType) + } + m.StartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + } + m.EndBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/options_vtproto.pb.go b/pb/sf/substreams/options_vtproto.pb.go new file mode 100644 index 000000000..648044543 --- /dev/null +++ b/pb/sf/substreams/options_vtproto.pb.go @@ -0,0 +1,221 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/options.proto + +package pbsubstreams + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *FieldOptions) CloneVT() *FieldOptions { + if m == nil { + return (*FieldOptions)(nil) + } + r := new(FieldOptions) + r.LoadFromFile = m.LoadFromFile + r.ZipFromFolder = m.ZipFromFolder + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *FieldOptions) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *FieldOptions) EqualVT(that *FieldOptions) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.LoadFromFile != that.LoadFromFile { + return false + } + if this.ZipFromFolder != that.ZipFromFolder { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *FieldOptions) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*FieldOptions) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *FieldOptions) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FieldOptions) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *FieldOptions) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ZipFromFolder { + i-- + if m.ZipFromFolder { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.LoadFromFile { + i-- + if m.LoadFromFile { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *FieldOptions) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LoadFromFile { + n += 2 + } + if m.ZipFromFolder { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *FieldOptions) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: FieldOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FieldOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LoadFromFile", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LoadFromFile = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ZipFromFolder", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ZipFromFolder = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/rpc/v2/service_vtproto.pb.go b/pb/sf/substreams/rpc/v2/service_vtproto.pb.go new file mode 100644 index 000000000..99f23f687 --- /dev/null +++ b/pb/sf/substreams/rpc/v2/service_vtproto.pb.go @@ -0,0 +1,7361 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/rpc/v2/service.proto + +package pbsubstreamsrpcv2 + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" + v1 "github.com/streamingfast/substreams/pb/sf/substreams/v1" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" +) + +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) +) + +func (m *Request) CloneVT() *Request { + if m == nil { + return (*Request)(nil) + } + r := new(Request) + r.StartBlockNum = m.StartBlockNum + r.StartCursor = m.StartCursor + r.StopBlockNum = m.StopBlockNum + r.FinalBlocksOnly = m.FinalBlocksOnly + r.ProductionMode = m.ProductionMode + r.OutputModule = m.OutputModule + r.Modules = m.Modules.CloneVT() + r.NoopMode = m.NoopMode + r.LimitProcessedBlocks = m.LimitProcessedBlocks + r.ProgressMessagesIntervalMs = m.ProgressMessagesIntervalMs + r.PartialBlocks = m.PartialBlocks + if rhs := m.DebugInitialStoreSnapshotForModules; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.DebugInitialStoreSnapshotForModules = tmpContainer + } + if rhs := m.DevOutputModules; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.DevOutputModules = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Request) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Response) CloneVT() *Response { + if m == nil { + return (*Response)(nil) + } + r := new(Response) + if m.Message != nil { + r.Message = m.Message.(interface{ CloneVT() isResponse_Message }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Response) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Response_Session) CloneVT() isResponse_Message { + if m == nil { + return (*Response_Session)(nil) + } + r := new(Response_Session) + r.Session = m.Session.CloneVT() + return r +} + +func (m *Response_Progress) CloneVT() isResponse_Message { + if m == nil { + return (*Response_Progress)(nil) + } + r := new(Response_Progress) + r.Progress = m.Progress.CloneVT() + return r +} + +func (m *Response_BlockScopedData) CloneVT() isResponse_Message { + if m == nil { + return (*Response_BlockScopedData)(nil) + } + r := new(Response_BlockScopedData) + r.BlockScopedData = m.BlockScopedData.CloneVT() + return r +} + +func (m *Response_BlockUndoSignal) CloneVT() isResponse_Message { + if m == nil { + return (*Response_BlockUndoSignal)(nil) + } + r := new(Response_BlockUndoSignal) + r.BlockUndoSignal = m.BlockUndoSignal.CloneVT() + return r +} + +func (m *Response_FatalError) CloneVT() isResponse_Message { + if m == nil { + return (*Response_FatalError)(nil) + } + r := new(Response_FatalError) + r.FatalError = m.FatalError.CloneVT() + return r +} + +func (m *Response_BlockScopedDatas) CloneVT() isResponse_Message { + if m == nil { + return (*Response_BlockScopedDatas)(nil) + } + r := new(Response_BlockScopedDatas) + r.BlockScopedDatas = m.BlockScopedDatas.CloneVT() + return r +} + +func (m *Response_DebugSnapshotData) CloneVT() isResponse_Message { + if m == nil { + return (*Response_DebugSnapshotData)(nil) + } + r := new(Response_DebugSnapshotData) + r.DebugSnapshotData = m.DebugSnapshotData.CloneVT() + return r +} + +func (m *Response_DebugSnapshotComplete) CloneVT() isResponse_Message { + if m == nil { + return (*Response_DebugSnapshotComplete)(nil) + } + r := new(Response_DebugSnapshotComplete) + r.DebugSnapshotComplete = m.DebugSnapshotComplete.CloneVT() + return r +} + +func (m *BlockUndoSignal) CloneVT() *BlockUndoSignal { + if m == nil { + return (*BlockUndoSignal)(nil) + } + r := new(BlockUndoSignal) + r.LastValidBlock = m.LastValidBlock.CloneVT() + r.LastValidCursor = m.LastValidCursor + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockUndoSignal) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BlockScopedDatas) CloneVT() *BlockScopedDatas { + if m == nil { + return (*BlockScopedDatas)(nil) + } + r := new(BlockScopedDatas) + if rhs := m.Items; rhs != nil { + tmpContainer := make([]*BlockScopedData, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Items = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockScopedDatas) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BlockScopedData) CloneVT() *BlockScopedData { + if m == nil { + return (*BlockScopedData)(nil) + } + r := new(BlockScopedData) + r.Output = m.Output.CloneVT() + r.Clock = m.Clock.CloneVT() + r.Cursor = m.Cursor + r.FinalBlockHeight = m.FinalBlockHeight + r.Attestation = m.Attestation + r.IsPartial = m.IsPartial + if rhs := m.DebugMapOutputs; rhs != nil { + tmpContainer := make([]*MapModuleOutput, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.DebugMapOutputs = tmpContainer + } + if rhs := m.DebugStoreOutputs; rhs != nil { + tmpContainer := make([]*StoreModuleOutput, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.DebugStoreOutputs = tmpContainer + } + if rhs := m.PartialIndex; rhs != nil { + tmpVal := *rhs + r.PartialIndex = &tmpVal + } + if rhs := m.IsLastPartial; rhs != nil { + tmpVal := *rhs + r.IsLastPartial = &tmpVal + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockScopedData) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SessionInit) CloneVT() *SessionInit { + if m == nil { + return (*SessionInit)(nil) + } + r := new(SessionInit) + r.TraceId = m.TraceId + r.ResolvedStartBlock = m.ResolvedStartBlock + r.LinearHandoffBlock = m.LinearHandoffBlock + r.MaxParallelWorkers = m.MaxParallelWorkers + r.AttestationPublicKey = m.AttestationPublicKey + r.ChainHead = m.ChainHead + r.BlocksToProcessBeforeStartBlock = m.BlocksToProcessBeforeStartBlock + r.EffectiveBlocksToProcessBeforeStartBlock = m.EffectiveBlocksToProcessBeforeStartBlock + r.BlocksToProcessAfterStartBlock = m.BlocksToProcessAfterStartBlock + r.EffectiveBlocksToProcessAfterStartBlock = m.EffectiveBlocksToProcessAfterStartBlock + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SessionInit) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *InitialSnapshotComplete) CloneVT() *InitialSnapshotComplete { + if m == nil { + return (*InitialSnapshotComplete)(nil) + } + r := new(InitialSnapshotComplete) + r.Cursor = m.Cursor + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InitialSnapshotComplete) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *InitialSnapshotData) CloneVT() *InitialSnapshotData { + if m == nil { + return (*InitialSnapshotData)(nil) + } + r := new(InitialSnapshotData) + r.ModuleName = m.ModuleName + r.SentKeys = m.SentKeys + r.TotalKeys = m.TotalKeys + if rhs := m.Deltas; rhs != nil { + tmpContainer := make([]*StoreDelta, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Deltas = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InitialSnapshotData) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MapModuleOutput) CloneVT() *MapModuleOutput { + if m == nil { + return (*MapModuleOutput)(nil) + } + r := new(MapModuleOutput) + r.Name = m.Name + r.MapOutput = (*anypb.Any)((*anypb1.Any)(m.MapOutput).CloneVT()) + r.DebugInfo = m.DebugInfo.CloneVT() + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *MapModuleOutput) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StoreModuleOutput) CloneVT() *StoreModuleOutput { + if m == nil { + return (*StoreModuleOutput)(nil) + } + r := new(StoreModuleOutput) + r.Name = m.Name + r.DebugInfo = m.DebugInfo.CloneVT() + if rhs := m.DebugStoreDeltas; rhs != nil { + tmpContainer := make([]*StoreDelta, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.DebugStoreDeltas = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StoreModuleOutput) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *OutputDebugInfo) CloneVT() *OutputDebugInfo { + if m == nil { + return (*OutputDebugInfo)(nil) + } + r := new(OutputDebugInfo) + r.LogsTruncated = m.LogsTruncated + r.Cached = m.Cached + if rhs := m.Logs; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Logs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *OutputDebugInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ModulesProgress) CloneVT() *ModulesProgress { + if m == nil { + return (*ModulesProgress)(nil) + } + r := new(ModulesProgress) + r.ProcessedBytes = m.ProcessedBytes.CloneVT() + r.ProcessedBlocks = m.ProcessedBlocks + if rhs := m.RunningJobs; rhs != nil { + tmpContainer := make([]*Job, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.RunningJobs = tmpContainer + } + if rhs := m.ModulesStats; rhs != nil { + tmpContainer := make([]*ModuleStats, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.ModulesStats = tmpContainer + } + if rhs := m.Stages; rhs != nil { + tmpContainer := make([]*Stage, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Stages = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ModulesProgress) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ProcessedBytes) CloneVT() *ProcessedBytes { + if m == nil { + return (*ProcessedBytes)(nil) + } + r := new(ProcessedBytes) + r.TotalBytesRead = m.TotalBytesRead + r.TotalBytesWritten = m.TotalBytesWritten + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ProcessedBytes) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Error) CloneVT() *Error { + if m == nil { + return (*Error)(nil) + } + r := new(Error) + r.Module = m.Module + r.Reason = m.Reason + r.LogsTruncated = m.LogsTruncated + if rhs := m.Logs; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Logs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Error) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Job) CloneVT() *Job { + if m == nil { + return (*Job)(nil) + } + r := new(Job) + r.Stage = m.Stage + r.StartBlock = m.StartBlock + r.StopBlock = m.StopBlock + r.ProgressBlocks = m.ProgressBlocks + r.DurationMs = m.DurationMs + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Job) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Stage) CloneVT() *Stage { + if m == nil { + return (*Stage)(nil) + } + r := new(Stage) + if rhs := m.Modules; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Modules = tmpContainer + } + if rhs := m.CompletedRanges; rhs != nil { + tmpContainer := make([]*BlockRange, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.CompletedRanges = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Stage) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ModuleStats) CloneVT() *ModuleStats { + if m == nil { + return (*ModuleStats)(nil) + } + r := new(ModuleStats) + r.Name = m.Name + r.TotalProcessedBlockCount = m.TotalProcessedBlockCount + r.TotalProcessingTimeMs = m.TotalProcessingTimeMs + r.TotalStoreOperationTimeMs = m.TotalStoreOperationTimeMs + r.TotalStoreReadCount = m.TotalStoreReadCount + r.TotalStoreWriteCount = m.TotalStoreWriteCount + r.TotalStoreDeleteprefixCount = m.TotalStoreDeleteprefixCount + r.StoreSizeBytes = m.StoreSizeBytes + r.TotalStoreMergingTimeMs = m.TotalStoreMergingTimeMs + r.StoreCurrentlyMerging = m.StoreCurrentlyMerging + r.HighestContiguousBlock = m.HighestContiguousBlock + if rhs := m.ExternalCallMetrics; rhs != nil { + tmpContainer := make([]*ExternalCallMetric, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.ExternalCallMetrics = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ModuleStats) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ExternalCallMetric) CloneVT() *ExternalCallMetric { + if m == nil { + return (*ExternalCallMetric)(nil) + } + r := new(ExternalCallMetric) + r.Name = m.Name + r.Count = m.Count + r.TimeMs = m.TimeMs + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ExternalCallMetric) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StoreDelta) CloneVT() *StoreDelta { + if m == nil { + return (*StoreDelta)(nil) + } + r := new(StoreDelta) + r.Operation = m.Operation + r.Ordinal = m.Ordinal + r.Key = m.Key + if rhs := m.OldValue; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.OldValue = tmpBytes + } + if rhs := m.NewValue; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.NewValue = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StoreDelta) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BlockRange) CloneVT() *BlockRange { + if m == nil { + return (*BlockRange)(nil) + } + r := new(BlockRange) + r.StartBlock = m.StartBlock + r.EndBlock = m.EndBlock + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockRange) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Request) EqualVT(that *Request) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StartBlockNum != that.StartBlockNum { + return false + } + if this.StartCursor != that.StartCursor { + return false + } + if this.StopBlockNum != that.StopBlockNum { + return false + } + if this.FinalBlocksOnly != that.FinalBlocksOnly { + return false + } + if this.ProductionMode != that.ProductionMode { + return false + } + if this.OutputModule != that.OutputModule { + return false + } + if !this.Modules.EqualVT(that.Modules) { + return false + } + if len(this.DebugInitialStoreSnapshotForModules) != len(that.DebugInitialStoreSnapshotForModules) { + return false + } + for i, vx := range this.DebugInitialStoreSnapshotForModules { + vy := that.DebugInitialStoreSnapshotForModules[i] + if vx != vy { + return false + } + } + if this.NoopMode != that.NoopMode { + return false + } + if this.LimitProcessedBlocks != that.LimitProcessedBlocks { + return false + } + if len(this.DevOutputModules) != len(that.DevOutputModules) { + return false + } + for i, vx := range this.DevOutputModules { + vy := that.DevOutputModules[i] + if vx != vy { + return false + } + } + if this.ProgressMessagesIntervalMs != that.ProgressMessagesIntervalMs { + return false + } + if this.PartialBlocks != that.PartialBlocks { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Request) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Request) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Response) EqualVT(that *Response) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Message == nil && that.Message != nil { + return false + } else if this.Message != nil { + if that.Message == nil { + return false + } + if !this.Message.(interface{ EqualVT(isResponse_Message) bool }).EqualVT(that.Message) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Response) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Response) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Response_Session) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_Session) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Session, that.Session; p != q { + if p == nil { + p = &SessionInit{} + } + if q == nil { + q = &SessionInit{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_Progress) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_Progress) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Progress, that.Progress; p != q { + if p == nil { + p = &ModulesProgress{} + } + if q == nil { + q = &ModulesProgress{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_BlockScopedData) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_BlockScopedData) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.BlockScopedData, that.BlockScopedData; p != q { + if p == nil { + p = &BlockScopedData{} + } + if q == nil { + q = &BlockScopedData{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_BlockUndoSignal) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_BlockUndoSignal) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.BlockUndoSignal, that.BlockUndoSignal; p != q { + if p == nil { + p = &BlockUndoSignal{} + } + if q == nil { + q = &BlockUndoSignal{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_FatalError) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_FatalError) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.FatalError, that.FatalError; p != q { + if p == nil { + p = &Error{} + } + if q == nil { + q = &Error{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_BlockScopedDatas) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_BlockScopedDatas) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.BlockScopedDatas, that.BlockScopedDatas; p != q { + if p == nil { + p = &BlockScopedDatas{} + } + if q == nil { + q = &BlockScopedDatas{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_DebugSnapshotData) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_DebugSnapshotData) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.DebugSnapshotData, that.DebugSnapshotData; p != q { + if p == nil { + p = &InitialSnapshotData{} + } + if q == nil { + q = &InitialSnapshotData{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_DebugSnapshotComplete) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_DebugSnapshotComplete) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.DebugSnapshotComplete, that.DebugSnapshotComplete; p != q { + if p == nil { + p = &InitialSnapshotComplete{} + } + if q == nil { + q = &InitialSnapshotComplete{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *BlockUndoSignal) EqualVT(that *BlockUndoSignal) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.LastValidBlock.EqualVT(that.LastValidBlock) { + return false + } + if this.LastValidCursor != that.LastValidCursor { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockUndoSignal) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockUndoSignal) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *BlockScopedDatas) EqualVT(that *BlockScopedDatas) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Items) != len(that.Items) { + return false + } + for i, vx := range this.Items { + vy := that.Items[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &BlockScopedData{} + } + if q == nil { + q = &BlockScopedData{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockScopedDatas) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockScopedDatas) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *BlockScopedData) EqualVT(that *BlockScopedData) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.Output.EqualVT(that.Output) { + return false + } + if !this.Clock.EqualVT(that.Clock) { + return false + } + if this.Cursor != that.Cursor { + return false + } + if this.FinalBlockHeight != that.FinalBlockHeight { + return false + } + if len(this.DebugMapOutputs) != len(that.DebugMapOutputs) { + return false + } + for i, vx := range this.DebugMapOutputs { + vy := that.DebugMapOutputs[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &MapModuleOutput{} + } + if q == nil { + q = &MapModuleOutput{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.DebugStoreOutputs) != len(that.DebugStoreOutputs) { + return false + } + for i, vx := range this.DebugStoreOutputs { + vy := that.DebugStoreOutputs[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &StoreModuleOutput{} + } + if q == nil { + q = &StoreModuleOutput{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.Attestation != that.Attestation { + return false + } + if this.IsPartial != that.IsPartial { + return false + } + if p, q := this.PartialIndex, that.PartialIndex; (p == nil && q != nil) || (p != nil && (q == nil || *p != *q)) { + return false + } + if p, q := this.IsLastPartial, that.IsLastPartial; (p == nil && q != nil) || (p != nil && (q == nil || *p != *q)) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockScopedData) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockScopedData) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SessionInit) EqualVT(that *SessionInit) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.TraceId != that.TraceId { + return false + } + if this.ResolvedStartBlock != that.ResolvedStartBlock { + return false + } + if this.LinearHandoffBlock != that.LinearHandoffBlock { + return false + } + if this.MaxParallelWorkers != that.MaxParallelWorkers { + return false + } + if this.AttestationPublicKey != that.AttestationPublicKey { + return false + } + if this.ChainHead != that.ChainHead { + return false + } + if this.BlocksToProcessBeforeStartBlock != that.BlocksToProcessBeforeStartBlock { + return false + } + if this.EffectiveBlocksToProcessBeforeStartBlock != that.EffectiveBlocksToProcessBeforeStartBlock { + return false + } + if this.BlocksToProcessAfterStartBlock != that.BlocksToProcessAfterStartBlock { + return false + } + if this.EffectiveBlocksToProcessAfterStartBlock != that.EffectiveBlocksToProcessAfterStartBlock { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SessionInit) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SessionInit) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *InitialSnapshotComplete) EqualVT(that *InitialSnapshotComplete) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Cursor != that.Cursor { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InitialSnapshotComplete) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InitialSnapshotComplete) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *InitialSnapshotData) EqualVT(that *InitialSnapshotData) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.ModuleName != that.ModuleName { + return false + } + if len(this.Deltas) != len(that.Deltas) { + return false + } + for i, vx := range this.Deltas { + vy := that.Deltas[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &StoreDelta{} + } + if q == nil { + q = &StoreDelta{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.TotalKeys != that.TotalKeys { + return false + } + if this.SentKeys != that.SentKeys { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InitialSnapshotData) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InitialSnapshotData) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *MapModuleOutput) EqualVT(that *MapModuleOutput) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if !(*anypb1.Any)(this.MapOutput).EqualVT((*anypb1.Any)(that.MapOutput)) { + return false + } + if !this.DebugInfo.EqualVT(that.DebugInfo) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *MapModuleOutput) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MapModuleOutput) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *StoreModuleOutput) EqualVT(that *StoreModuleOutput) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if len(this.DebugStoreDeltas) != len(that.DebugStoreDeltas) { + return false + } + for i, vx := range this.DebugStoreDeltas { + vy := that.DebugStoreDeltas[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &StoreDelta{} + } + if q == nil { + q = &StoreDelta{} + } + if !p.EqualVT(q) { + return false + } + } + } + if !this.DebugInfo.EqualVT(that.DebugInfo) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StoreModuleOutput) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StoreModuleOutput) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *OutputDebugInfo) EqualVT(that *OutputDebugInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Logs) != len(that.Logs) { + return false + } + for i, vx := range this.Logs { + vy := that.Logs[i] + if vx != vy { + return false + } + } + if this.LogsTruncated != that.LogsTruncated { + return false + } + if this.Cached != that.Cached { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *OutputDebugInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*OutputDebugInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ModulesProgress) EqualVT(that *ModulesProgress) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.RunningJobs) != len(that.RunningJobs) { + return false + } + for i, vx := range this.RunningJobs { + vy := that.RunningJobs[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Job{} + } + if q == nil { + q = &Job{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.ModulesStats) != len(that.ModulesStats) { + return false + } + for i, vx := range this.ModulesStats { + vy := that.ModulesStats[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ModuleStats{} + } + if q == nil { + q = &ModuleStats{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.Stages) != len(that.Stages) { + return false + } + for i, vx := range this.Stages { + vy := that.Stages[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Stage{} + } + if q == nil { + q = &Stage{} + } + if !p.EqualVT(q) { + return false + } + } + } + if !this.ProcessedBytes.EqualVT(that.ProcessedBytes) { + return false + } + if this.ProcessedBlocks != that.ProcessedBlocks { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ModulesProgress) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ModulesProgress) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ProcessedBytes) EqualVT(that *ProcessedBytes) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.TotalBytesRead != that.TotalBytesRead { + return false + } + if this.TotalBytesWritten != that.TotalBytesWritten { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ProcessedBytes) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ProcessedBytes) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Error) EqualVT(that *Error) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Module != that.Module { + return false + } + if this.Reason != that.Reason { + return false + } + if len(this.Logs) != len(that.Logs) { + return false + } + for i, vx := range this.Logs { + vy := that.Logs[i] + if vx != vy { + return false + } + } + if this.LogsTruncated != that.LogsTruncated { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Error) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Error) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Job) EqualVT(that *Job) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Stage != that.Stage { + return false + } + if this.StartBlock != that.StartBlock { + return false + } + if this.StopBlock != that.StopBlock { + return false + } + if this.ProgressBlocks != that.ProgressBlocks { + return false + } + if this.DurationMs != that.DurationMs { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Job) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Job) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Stage) EqualVT(that *Stage) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Modules) != len(that.Modules) { + return false + } + for i, vx := range this.Modules { + vy := that.Modules[i] + if vx != vy { + return false + } + } + if len(this.CompletedRanges) != len(that.CompletedRanges) { + return false + } + for i, vx := range this.CompletedRanges { + vy := that.CompletedRanges[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &BlockRange{} + } + if q == nil { + q = &BlockRange{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Stage) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Stage) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ModuleStats) EqualVT(that *ModuleStats) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.TotalProcessedBlockCount != that.TotalProcessedBlockCount { + return false + } + if this.TotalProcessingTimeMs != that.TotalProcessingTimeMs { + return false + } + if len(this.ExternalCallMetrics) != len(that.ExternalCallMetrics) { + return false + } + for i, vx := range this.ExternalCallMetrics { + vy := that.ExternalCallMetrics[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ExternalCallMetric{} + } + if q == nil { + q = &ExternalCallMetric{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.TotalStoreOperationTimeMs != that.TotalStoreOperationTimeMs { + return false + } + if this.TotalStoreReadCount != that.TotalStoreReadCount { + return false + } + if this.TotalStoreWriteCount != that.TotalStoreWriteCount { + return false + } + if this.TotalStoreDeleteprefixCount != that.TotalStoreDeleteprefixCount { + return false + } + if this.StoreSizeBytes != that.StoreSizeBytes { + return false + } + if this.TotalStoreMergingTimeMs != that.TotalStoreMergingTimeMs { + return false + } + if this.StoreCurrentlyMerging != that.StoreCurrentlyMerging { + return false + } + if this.HighestContiguousBlock != that.HighestContiguousBlock { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ModuleStats) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ModuleStats) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ExternalCallMetric) EqualVT(that *ExternalCallMetric) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Count != that.Count { + return false + } + if this.TimeMs != that.TimeMs { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ExternalCallMetric) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ExternalCallMetric) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *StoreDelta) EqualVT(that *StoreDelta) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Operation != that.Operation { + return false + } + if this.Ordinal != that.Ordinal { + return false + } + if this.Key != that.Key { + return false + } + if string(this.OldValue) != string(that.OldValue) { + return false + } + if string(this.NewValue) != string(that.NewValue) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StoreDelta) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StoreDelta) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *BlockRange) EqualVT(that *BlockRange) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StartBlock != that.StartBlock { + return false + } + if this.EndBlock != that.EndBlock { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockRange) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockRange) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Request) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Request) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Request) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.PartialBlocks { + i-- + if m.PartialBlocks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.ProgressMessagesIntervalMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProgressMessagesIntervalMs)) + i-- + dAtA[i] = 0x70 + } + if len(m.DevOutputModules) > 0 { + for iNdEx := len(m.DevOutputModules) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DevOutputModules[iNdEx]) + copy(dAtA[i:], m.DevOutputModules[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DevOutputModules[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if m.LimitProcessedBlocks != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LimitProcessedBlocks)) + i-- + dAtA[i] = 0x60 + } + if m.NoopMode { + i-- + if m.NoopMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if len(m.DebugInitialStoreSnapshotForModules) > 0 { + for iNdEx := len(m.DebugInitialStoreSnapshotForModules) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DebugInitialStoreSnapshotForModules[iNdEx]) + copy(dAtA[i:], m.DebugInitialStoreSnapshotForModules[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DebugInitialStoreSnapshotForModules[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if m.Modules != nil { + size, err := m.Modules.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if len(m.OutputModule) > 0 { + i -= len(m.OutputModule) + copy(dAtA[i:], m.OutputModule) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OutputModule))) + i-- + dAtA[i] = 0x32 + } + if m.ProductionMode { + i-- + if m.ProductionMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.FinalBlocksOnly { + i-- + if m.FinalBlocksOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.StopBlockNum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StopBlockNum)) + i-- + dAtA[i] = 0x18 + } + if len(m.StartCursor) > 0 { + i -= len(m.StartCursor) + copy(dAtA[i:], m.StartCursor) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StartCursor))) + i-- + dAtA[i] = 0x12 + } + if m.StartBlockNum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartBlockNum)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Response) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Response) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Message.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *Response_Session) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_Session) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Session != nil { + size, err := m.Session.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Response_Progress) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_Progress) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Progress != nil { + size, err := m.Progress.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Response_BlockScopedData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_BlockScopedData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BlockScopedData != nil { + size, err := m.BlockScopedData.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Response_BlockUndoSignal) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_BlockUndoSignal) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BlockUndoSignal != nil { + size, err := m.BlockUndoSignal.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Response_FatalError) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_FatalError) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FatalError != nil { + size, err := m.FatalError.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Response_BlockScopedDatas) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_BlockScopedDatas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BlockScopedDatas != nil { + size, err := m.BlockScopedDatas.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *Response_DebugSnapshotData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_DebugSnapshotData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DebugSnapshotData != nil { + size, err := m.DebugSnapshotData.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + return len(dAtA) - i, nil +} +func (m *Response_DebugSnapshotComplete) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_DebugSnapshotComplete) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DebugSnapshotComplete != nil { + size, err := m.DebugSnapshotComplete.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + return len(dAtA) - i, nil +} +func (m *BlockUndoSignal) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockUndoSignal) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockUndoSignal) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.LastValidCursor) > 0 { + i -= len(m.LastValidCursor) + copy(dAtA[i:], m.LastValidCursor) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LastValidCursor))) + i-- + dAtA[i] = 0x12 + } + if m.LastValidBlock != nil { + size, err := m.LastValidBlock.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockScopedDatas) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockScopedDatas) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockScopedDatas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Items[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *BlockScopedData) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockScopedData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockScopedData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.IsLastPartial != nil { + i-- + if *m.IsLastPartial { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if m.PartialIndex != nil { + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.PartialIndex)) + i-- + dAtA[i] = 0x70 + } + if m.IsPartial { + i-- + if m.IsPartial { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + if len(m.Attestation) > 0 { + i -= len(m.Attestation) + copy(dAtA[i:], m.Attestation) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Attestation))) + i-- + dAtA[i] = 0x62 + } + if len(m.DebugStoreOutputs) > 0 { + for iNdEx := len(m.DebugStoreOutputs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.DebugStoreOutputs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + } + if len(m.DebugMapOutputs) > 0 { + for iNdEx := len(m.DebugMapOutputs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.DebugMapOutputs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + } + if m.FinalBlockHeight != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FinalBlockHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.Cursor) > 0 { + i -= len(m.Cursor) + copy(dAtA[i:], m.Cursor) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Cursor))) + i-- + dAtA[i] = 0x1a + } + if m.Clock != nil { + size, err := m.Clock.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Output != nil { + size, err := m.Output.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SessionInit) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SessionInit) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SessionInit) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.EffectiveBlocksToProcessAfterStartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EffectiveBlocksToProcessAfterStartBlock)) + i-- + dAtA[i] = 0x50 + } + if m.BlocksToProcessAfterStartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BlocksToProcessAfterStartBlock)) + i-- + dAtA[i] = 0x48 + } + if m.EffectiveBlocksToProcessBeforeStartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EffectiveBlocksToProcessBeforeStartBlock)) + i-- + dAtA[i] = 0x40 + } + if m.BlocksToProcessBeforeStartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BlocksToProcessBeforeStartBlock)) + i-- + dAtA[i] = 0x38 + } + if m.ChainHead != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChainHead)) + i-- + dAtA[i] = 0x30 + } + if len(m.AttestationPublicKey) > 0 { + i -= len(m.AttestationPublicKey) + copy(dAtA[i:], m.AttestationPublicKey) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AttestationPublicKey))) + i-- + dAtA[i] = 0x2a + } + if m.MaxParallelWorkers != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxParallelWorkers)) + i-- + dAtA[i] = 0x20 + } + if m.LinearHandoffBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LinearHandoffBlock)) + i-- + dAtA[i] = 0x18 + } + if m.ResolvedStartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ResolvedStartBlock)) + i-- + dAtA[i] = 0x10 + } + if len(m.TraceId) > 0 { + i -= len(m.TraceId) + copy(dAtA[i:], m.TraceId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TraceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InitialSnapshotComplete) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InitialSnapshotComplete) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InitialSnapshotComplete) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Cursor) > 0 { + i -= len(m.Cursor) + copy(dAtA[i:], m.Cursor) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Cursor))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InitialSnapshotData) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InitialSnapshotData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InitialSnapshotData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.SentKeys != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SentKeys)) + i-- + dAtA[i] = 0x20 + } + if m.TotalKeys != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalKeys)) + i-- + dAtA[i] = 0x18 + } + if len(m.Deltas) > 0 { + for iNdEx := len(m.Deltas) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Deltas[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.ModuleName) > 0 { + i -= len(m.ModuleName) + copy(dAtA[i:], m.ModuleName) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ModuleName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MapModuleOutput) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MapModuleOutput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MapModuleOutput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DebugInfo != nil { + size, err := m.DebugInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if m.MapOutput != nil { + size, err := (*anypb1.Any)(m.MapOutput).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StoreModuleOutput) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreModuleOutput) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StoreModuleOutput) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DebugInfo != nil { + size, err := m.DebugInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if len(m.DebugStoreDeltas) > 0 { + for iNdEx := len(m.DebugStoreDeltas) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.DebugStoreDeltas[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OutputDebugInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OutputDebugInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OutputDebugInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Cached { + i-- + if m.Cached { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.LogsTruncated { + i-- + if m.LogsTruncated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Logs[iNdEx]) + copy(dAtA[i:], m.Logs[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Logs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ModulesProgress) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModulesProgress) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModulesProgress) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ProcessedBlocks != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProcessedBlocks)) + i-- + dAtA[i] = 0x30 + } + if m.ProcessedBytes != nil { + size, err := m.ProcessedBytes.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if len(m.Stages) > 0 { + for iNdEx := len(m.Stages) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Stages[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ModulesStats) > 0 { + for iNdEx := len(m.ModulesStats) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ModulesStats[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.RunningJobs) > 0 { + for iNdEx := len(m.RunningJobs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.RunningJobs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func (m *ProcessedBytes) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessedBytes) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ProcessedBytes) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.TotalBytesWritten != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalBytesWritten)) + i-- + dAtA[i] = 0x10 + } + if m.TotalBytesRead != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalBytesRead)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Error) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Error) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Error) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.LogsTruncated { + i-- + if m.LogsTruncated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Logs[iNdEx]) + copy(dAtA[i:], m.Logs[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Logs[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Job) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Job) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Job) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DurationMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DurationMs)) + i-- + dAtA[i] = 0x28 + } + if m.ProgressBlocks != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProgressBlocks)) + i-- + dAtA[i] = 0x20 + } + if m.StopBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StopBlock)) + i-- + dAtA[i] = 0x18 + } + if m.StartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartBlock)) + i-- + dAtA[i] = 0x10 + } + if m.Stage != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Stage)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Stage) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Stage) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Stage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.CompletedRanges) > 0 { + for iNdEx := len(m.CompletedRanges) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.CompletedRanges[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Modules) > 0 { + for iNdEx := len(m.Modules) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Modules[iNdEx]) + copy(dAtA[i:], m.Modules[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Modules[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ModuleStats) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModuleStats) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModuleStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.HighestContiguousBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HighestContiguousBlock)) + i-- + dAtA[i] = 0x78 + } + if m.StoreCurrentlyMerging { + i-- + if m.StoreCurrentlyMerging { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if m.TotalStoreMergingTimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalStoreMergingTimeMs)) + i-- + dAtA[i] = 0x68 + } + if m.StoreSizeBytes != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StoreSizeBytes)) + i-- + dAtA[i] = 0x60 + } + if m.TotalStoreDeleteprefixCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalStoreDeleteprefixCount)) + i-- + dAtA[i] = 0x58 + } + if m.TotalStoreWriteCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalStoreWriteCount)) + i-- + dAtA[i] = 0x50 + } + if m.TotalStoreReadCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalStoreReadCount)) + i-- + dAtA[i] = 0x30 + } + if m.TotalStoreOperationTimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalStoreOperationTimeMs)) + i-- + dAtA[i] = 0x28 + } + if len(m.ExternalCallMetrics) > 0 { + for iNdEx := len(m.ExternalCallMetrics) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ExternalCallMetrics[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if m.TotalProcessingTimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalProcessingTimeMs)) + i-- + dAtA[i] = 0x18 + } + if m.TotalProcessedBlockCount != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalProcessedBlockCount)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExternalCallMetric) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExternalCallMetric) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ExternalCallMetric) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.TimeMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TimeMs)) + i-- + dAtA[i] = 0x18 + } + if m.Count != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StoreDelta) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreDelta) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StoreDelta) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.NewValue) > 0 { + i -= len(m.NewValue) + copy(dAtA[i:], m.NewValue) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.NewValue))) + i-- + dAtA[i] = 0x2a + } + if len(m.OldValue) > 0 { + i -= len(m.OldValue) + copy(dAtA[i:], m.OldValue) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OldValue))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if m.Ordinal != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Ordinal)) + i-- + dAtA[i] = 0x10 + } + if m.Operation != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Operation)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BlockRange) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockRange) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockRange) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.EndBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.EndBlock)) + i-- + dAtA[i] = 0x18 + } + if m.StartBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartBlock)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *Request) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartBlockNum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartBlockNum)) + } + l = len(m.StartCursor) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.StopBlockNum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StopBlockNum)) + } + if m.FinalBlocksOnly { + n += 2 + } + if m.ProductionMode { + n += 2 + } + l = len(m.OutputModule) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Modules != nil { + l = m.Modules.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.DebugInitialStoreSnapshotForModules) > 0 { + for _, s := range m.DebugInitialStoreSnapshotForModules { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.NoopMode { + n += 2 + } + if m.LimitProcessedBlocks != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LimitProcessedBlocks)) + } + if len(m.DevOutputModules) > 0 { + for _, s := range m.DevOutputModules { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.ProgressMessagesIntervalMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProgressMessagesIntervalMs)) + } + if m.PartialBlocks { + n += 3 + } + n += len(m.unknownFields) + return n +} + +func (m *Response) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Message.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *Response_Session) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Session != nil { + l = m.Session.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_Progress) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Progress != nil { + l = m.Progress.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_BlockScopedData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockScopedData != nil { + l = m.BlockScopedData.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_BlockUndoSignal) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockUndoSignal != nil { + l = m.BlockUndoSignal.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_FatalError) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FatalError != nil { + l = m.FatalError.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_BlockScopedDatas) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockScopedDatas != nil { + l = m.BlockScopedDatas.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_DebugSnapshotData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DebugSnapshotData != nil { + l = m.DebugSnapshotData.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_DebugSnapshotComplete) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DebugSnapshotComplete != nil { + l = m.DebugSnapshotComplete.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *BlockUndoSignal) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LastValidBlock != nil { + l = m.LastValidBlock.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.LastValidCursor) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BlockScopedDatas) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *BlockScopedData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Output != nil { + l = m.Output.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Clock != nil { + l = m.Clock.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Cursor) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.FinalBlockHeight != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.FinalBlockHeight)) + } + if len(m.DebugMapOutputs) > 0 { + for _, e := range m.DebugMapOutputs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.DebugStoreOutputs) > 0 { + for _, e := range m.DebugStoreOutputs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.Attestation) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.IsPartial { + n += 2 + } + if m.PartialIndex != nil { + n += 1 + protohelpers.SizeOfVarint(uint64(*m.PartialIndex)) + } + if m.IsLastPartial != nil { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *SessionInit) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TraceId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ResolvedStartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ResolvedStartBlock)) + } + if m.LinearHandoffBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LinearHandoffBlock)) + } + if m.MaxParallelWorkers != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxParallelWorkers)) + } + l = len(m.AttestationPublicKey) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ChainHead != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ChainHead)) + } + if m.BlocksToProcessBeforeStartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.BlocksToProcessBeforeStartBlock)) + } + if m.EffectiveBlocksToProcessBeforeStartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EffectiveBlocksToProcessBeforeStartBlock)) + } + if m.BlocksToProcessAfterStartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.BlocksToProcessAfterStartBlock)) + } + if m.EffectiveBlocksToProcessAfterStartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EffectiveBlocksToProcessAfterStartBlock)) + } + n += len(m.unknownFields) + return n +} + +func (m *InitialSnapshotComplete) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cursor) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *InitialSnapshotData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ModuleName) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Deltas) > 0 { + for _, e := range m.Deltas { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.TotalKeys != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalKeys)) + } + if m.SentKeys != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.SentKeys)) + } + n += len(m.unknownFields) + return n +} + +func (m *MapModuleOutput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.MapOutput != nil { + l = (*anypb1.Any)(m.MapOutput).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DebugInfo != nil { + l = m.DebugInfo.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StoreModuleOutput) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.DebugStoreDeltas) > 0 { + for _, e := range m.DebugStoreDeltas { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.DebugInfo != nil { + l = m.DebugInfo.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *OutputDebugInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Logs) > 0 { + for _, s := range m.Logs { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.LogsTruncated { + n += 2 + } + if m.Cached { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ModulesProgress) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RunningJobs) > 0 { + for _, e := range m.RunningJobs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.ModulesStats) > 0 { + for _, e := range m.ModulesStats { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Stages) > 0 { + for _, e := range m.Stages { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.ProcessedBytes != nil { + l = m.ProcessedBytes.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ProcessedBlocks != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProcessedBlocks)) + } + n += len(m.unknownFields) + return n +} + +func (m *ProcessedBytes) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalBytesRead != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalBytesRead)) + } + if m.TotalBytesWritten != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalBytesWritten)) + } + n += len(m.unknownFields) + return n +} + +func (m *Error) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Logs) > 0 { + for _, s := range m.Logs { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.LogsTruncated { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *Job) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Stage != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Stage)) + } + if m.StartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartBlock)) + } + if m.StopBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StopBlock)) + } + if m.ProgressBlocks != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProgressBlocks)) + } + if m.DurationMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.DurationMs)) + } + n += len(m.unknownFields) + return n +} + +func (m *Stage) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Modules) > 0 { + for _, s := range m.Modules { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.CompletedRanges) > 0 { + for _, e := range m.CompletedRanges { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *ModuleStats) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.TotalProcessedBlockCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalProcessedBlockCount)) + } + if m.TotalProcessingTimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalProcessingTimeMs)) + } + if len(m.ExternalCallMetrics) > 0 { + for _, e := range m.ExternalCallMetrics { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.TotalStoreOperationTimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalStoreOperationTimeMs)) + } + if m.TotalStoreReadCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalStoreReadCount)) + } + if m.TotalStoreWriteCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalStoreWriteCount)) + } + if m.TotalStoreDeleteprefixCount != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalStoreDeleteprefixCount)) + } + if m.StoreSizeBytes != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StoreSizeBytes)) + } + if m.TotalStoreMergingTimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalStoreMergingTimeMs)) + } + if m.StoreCurrentlyMerging { + n += 2 + } + if m.HighestContiguousBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.HighestContiguousBlock)) + } + n += len(m.unknownFields) + return n +} + +func (m *ExternalCallMetric) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Count != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Count)) + } + if m.TimeMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.TimeMs)) + } + n += len(m.unknownFields) + return n +} + +func (m *StoreDelta) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Operation != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Operation)) + } + if m.Ordinal != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Ordinal)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.OldValue) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.NewValue) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BlockRange) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartBlock)) + } + if m.EndBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.EndBlock)) + } + n += len(m.unknownFields) + return n +} + +func (m *Request) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Request: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBlockNum", wireType) + } + m.StartBlockNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBlockNum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartCursor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartCursor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StopBlockNum", wireType) + } + m.StopBlockNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StopBlockNum |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalBlocksOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FinalBlocksOnly = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProductionMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ProductionMode = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputModule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutputModule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Modules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Modules == nil { + m.Modules = &v1.Modules{} + } + if err := m.Modules.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugInitialStoreSnapshotForModules", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebugInitialStoreSnapshotForModules = append(m.DebugInitialStoreSnapshotForModules, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoopMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoopMode = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitProcessedBlocks", wireType) + } + m.LimitProcessedBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LimitProcessedBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DevOutputModules", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DevOutputModules = append(m.DevOutputModules, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProgressMessagesIntervalMs", wireType) + } + m.ProgressMessagesIntervalMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProgressMessagesIntervalMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialBlocks", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PartialBlocks = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Response) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Session", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_Session); ok { + if err := oneof.Session.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &SessionInit{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_Session{Session: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Progress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_Progress); ok { + if err := oneof.Progress.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &ModulesProgress{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_Progress{Progress: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockScopedData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_BlockScopedData); ok { + if err := oneof.BlockScopedData.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &BlockScopedData{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_BlockScopedData{BlockScopedData: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockUndoSignal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_BlockUndoSignal); ok { + if err := oneof.BlockUndoSignal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &BlockUndoSignal{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_BlockUndoSignal{BlockUndoSignal: v} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FatalError", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_FatalError); ok { + if err := oneof.FatalError.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Error{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_FatalError{FatalError: v} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockScopedDatas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_BlockScopedDatas); ok { + if err := oneof.BlockScopedDatas.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &BlockScopedDatas{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_BlockScopedDatas{BlockScopedDatas: v} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugSnapshotData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_DebugSnapshotData); ok { + if err := oneof.DebugSnapshotData.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &InitialSnapshotData{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_DebugSnapshotData{DebugSnapshotData: v} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugSnapshotComplete", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_DebugSnapshotComplete); ok { + if err := oneof.DebugSnapshotComplete.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &InitialSnapshotComplete{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_DebugSnapshotComplete{DebugSnapshotComplete: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockUndoSignal) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockUndoSignal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockUndoSignal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastValidBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastValidBlock == nil { + m.LastValidBlock = &v1.BlockRef{} + } + if err := m.LastValidBlock.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastValidCursor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastValidCursor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockScopedDatas) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockScopedDatas: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockScopedDatas: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, &BlockScopedData{}) + if err := m.Items[len(m.Items)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockScopedData) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockScopedData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockScopedData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output == nil { + m.Output = &MapModuleOutput{} + } + if err := m.Output.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Clock == nil { + m.Clock = &v1.Clock{} + } + if err := m.Clock.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cursor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cursor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalBlockHeight", wireType) + } + m.FinalBlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FinalBlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugMapOutputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebugMapOutputs = append(m.DebugMapOutputs, &MapModuleOutput{}) + if err := m.DebugMapOutputs[len(m.DebugMapOutputs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugStoreOutputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebugStoreOutputs = append(m.DebugStoreOutputs, &StoreModuleOutput{}) + if err := m.DebugStoreOutputs[len(m.DebugStoreOutputs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attestation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attestation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsPartial", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsPartial = bool(v != 0) + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialIndex", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PartialIndex = &v + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLastPartial", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.IsLastPartial = &b + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SessionInit) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SessionInit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SessionInit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResolvedStartBlock", wireType) + } + m.ResolvedStartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResolvedStartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LinearHandoffBlock", wireType) + } + m.LinearHandoffBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LinearHandoffBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxParallelWorkers", wireType) + } + m.MaxParallelWorkers = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxParallelWorkers |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttestationPublicKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttestationPublicKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainHead", wireType) + } + m.ChainHead = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainHead |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksToProcessBeforeStartBlock", wireType) + } + m.BlocksToProcessBeforeStartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksToProcessBeforeStartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EffectiveBlocksToProcessBeforeStartBlock", wireType) + } + m.EffectiveBlocksToProcessBeforeStartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EffectiveBlocksToProcessBeforeStartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksToProcessAfterStartBlock", wireType) + } + m.BlocksToProcessAfterStartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksToProcessAfterStartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EffectiveBlocksToProcessAfterStartBlock", wireType) + } + m.EffectiveBlocksToProcessAfterStartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EffectiveBlocksToProcessAfterStartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InitialSnapshotComplete) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: InitialSnapshotComplete: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InitialSnapshotComplete: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cursor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cursor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InitialSnapshotData) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: InitialSnapshotData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InitialSnapshotData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deltas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deltas = append(m.Deltas, &StoreDelta{}) + if err := m.Deltas[len(m.Deltas)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalKeys", wireType) + } + m.TotalKeys = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalKeys |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SentKeys", wireType) + } + m.SentKeys = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SentKeys |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MapModuleOutput) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: MapModuleOutput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MapModuleOutput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MapOutput", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MapOutput == nil { + m.MapOutput = &anypb.Any{} + } + if err := (*anypb1.Any)(m.MapOutput).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DebugInfo == nil { + m.DebugInfo = &OutputDebugInfo{} + } + if err := m.DebugInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StoreModuleOutput) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: StoreModuleOutput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreModuleOutput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugStoreDeltas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebugStoreDeltas = append(m.DebugStoreDeltas, &StoreDelta{}) + if err := m.DebugStoreDeltas[len(m.DebugStoreDeltas)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DebugInfo == nil { + m.DebugInfo = &OutputDebugInfo{} + } + if err := m.DebugInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutputDebugInfo) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: OutputDebugInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OutputDebugInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LogsTruncated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LogsTruncated = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Cached", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Cached = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModulesProgress) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ModulesProgress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModulesProgress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunningJobs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunningJobs = append(m.RunningJobs, &Job{}) + if err := m.RunningJobs[len(m.RunningJobs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModulesStats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModulesStats = append(m.ModulesStats, &ModuleStats{}) + if err := m.ModulesStats[len(m.ModulesStats)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stages = append(m.Stages, &Stage{}) + if err := m.Stages[len(m.Stages)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessedBytes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProcessedBytes == nil { + m.ProcessedBytes = &ProcessedBytes{} + } + if err := m.ProcessedBytes.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessedBlocks", wireType) + } + m.ProcessedBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProcessedBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProcessedBytes) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ProcessedBytes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessedBytes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBytesRead", wireType) + } + m.TotalBytesRead = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalBytesRead |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalBytesWritten", wireType) + } + m.TotalBytesWritten = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalBytesWritten |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Error) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Error: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Error: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LogsTruncated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LogsTruncated = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Job) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Job: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Job: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Stage", wireType) + } + m.Stage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Stage |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBlock", wireType) + } + m.StartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StopBlock", wireType) + } + m.StopBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StopBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProgressBlocks", wireType) + } + m.ProgressBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProgressBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationMs", wireType) + } + m.DurationMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DurationMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Stage) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Stage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Stage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Modules", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Modules = append(m.Modules, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletedRanges", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CompletedRanges = append(m.CompletedRanges, &BlockRange{}) + if err := m.CompletedRanges[len(m.CompletedRanges)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleStats) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ModuleStats: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalProcessedBlockCount", wireType) + } + m.TotalProcessedBlockCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalProcessedBlockCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalProcessingTimeMs", wireType) + } + m.TotalProcessingTimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalProcessingTimeMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExternalCallMetrics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExternalCallMetrics = append(m.ExternalCallMetrics, &ExternalCallMetric{}) + if err := m.ExternalCallMetrics[len(m.ExternalCallMetrics)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalStoreOperationTimeMs", wireType) + } + m.TotalStoreOperationTimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalStoreOperationTimeMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalStoreReadCount", wireType) + } + m.TotalStoreReadCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalStoreReadCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalStoreWriteCount", wireType) + } + m.TotalStoreWriteCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalStoreWriteCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalStoreDeleteprefixCount", wireType) + } + m.TotalStoreDeleteprefixCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalStoreDeleteprefixCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreSizeBytes", wireType) + } + m.StoreSizeBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StoreSizeBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalStoreMergingTimeMs", wireType) + } + m.TotalStoreMergingTimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalStoreMergingTimeMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreCurrentlyMerging", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.StoreCurrentlyMerging = bool(v != 0) + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HighestContiguousBlock", wireType) + } + m.HighestContiguousBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HighestContiguousBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExternalCallMetric) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ExternalCallMetric: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExternalCallMetric: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeMs", wireType) + } + m.TimeMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StoreDelta) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: StoreDelta: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreDelta: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + m.Operation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Operation |= StoreDelta_Operation(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ordinal", wireType) + } + m.Ordinal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ordinal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldValue", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OldValue = append(m.OldValue[:0], dAtA[iNdEx:postIndex]...) + if m.OldValue == nil { + m.OldValue = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewValue", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewValue = append(m.NewValue[:0], dAtA[iNdEx:postIndex]...) + if m.NewValue == nil { + m.NewValue = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockRange) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBlock", wireType) + } + m.StartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) + } + m.EndBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/rpc/v3/service_vtproto.pb.go b/pb/sf/substreams/rpc/v3/service_vtproto.pb.go new file mode 100644 index 000000000..d6de0915e --- /dev/null +++ b/pb/sf/substreams/rpc/v3/service_vtproto.pb.go @@ -0,0 +1,912 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/rpc/v3/service.proto + +package pbsubstreamsrpcv3 + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + v1 "github.com/streamingfast/substreams/pb/sf/substreams/v1" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *Request) CloneVT() *Request { + if m == nil { + return (*Request)(nil) + } + r := new(Request) + r.StartBlockNum = m.StartBlockNum + r.StartCursor = m.StartCursor + r.StopBlockNum = m.StopBlockNum + r.FinalBlocksOnly = m.FinalBlocksOnly + r.ProductionMode = m.ProductionMode + r.OutputModule = m.OutputModule + r.Package = m.Package.CloneVT() + r.Network = m.Network + r.NoopMode = m.NoopMode + r.LimitProcessedBlocks = m.LimitProcessedBlocks + r.ProgressMessagesIntervalMs = m.ProgressMessagesIntervalMs + r.PartialBlocks = m.PartialBlocks + if rhs := m.Params; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.Params = tmpContainer + } + if rhs := m.DebugInitialStoreSnapshotForModules; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.DebugInitialStoreSnapshotForModules = tmpContainer + } + if rhs := m.DevOutputModules; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.DevOutputModules = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Request) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Request) EqualVT(that *Request) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.StartBlockNum != that.StartBlockNum { + return false + } + if this.StartCursor != that.StartCursor { + return false + } + if this.StopBlockNum != that.StopBlockNum { + return false + } + if this.FinalBlocksOnly != that.FinalBlocksOnly { + return false + } + if this.ProductionMode != that.ProductionMode { + return false + } + if this.OutputModule != that.OutputModule { + return false + } + if !this.Package.EqualVT(that.Package) { + return false + } + if len(this.Params) != len(that.Params) { + return false + } + for i, vx := range this.Params { + vy, ok := that.Params[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + if this.Network != that.Network { + return false + } + if len(this.DebugInitialStoreSnapshotForModules) != len(that.DebugInitialStoreSnapshotForModules) { + return false + } + for i, vx := range this.DebugInitialStoreSnapshotForModules { + vy := that.DebugInitialStoreSnapshotForModules[i] + if vx != vy { + return false + } + } + if this.NoopMode != that.NoopMode { + return false + } + if this.LimitProcessedBlocks != that.LimitProcessedBlocks { + return false + } + if len(this.DevOutputModules) != len(that.DevOutputModules) { + return false + } + for i, vx := range this.DevOutputModules { + vy := that.DevOutputModules[i] + if vx != vy { + return false + } + } + if this.ProgressMessagesIntervalMs != that.ProgressMessagesIntervalMs { + return false + } + if this.PartialBlocks != that.PartialBlocks { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Request) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Request) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Request) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Request) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Request) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.PartialBlocks { + i-- + if m.PartialBlocks { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.ProgressMessagesIntervalMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProgressMessagesIntervalMs)) + i-- + dAtA[i] = 0x70 + } + if len(m.DevOutputModules) > 0 { + for iNdEx := len(m.DevOutputModules) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DevOutputModules[iNdEx]) + copy(dAtA[i:], m.DevOutputModules[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DevOutputModules[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if m.LimitProcessedBlocks != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LimitProcessedBlocks)) + i-- + dAtA[i] = 0x60 + } + if m.NoopMode { + i-- + if m.NoopMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if len(m.DebugInitialStoreSnapshotForModules) > 0 { + for iNdEx := len(m.DebugInitialStoreSnapshotForModules) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DebugInitialStoreSnapshotForModules[iNdEx]) + copy(dAtA[i:], m.DebugInitialStoreSnapshotForModules[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DebugInitialStoreSnapshotForModules[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if len(m.Network) > 0 { + i -= len(m.Network) + copy(dAtA[i:], m.Network) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Network))) + i-- + dAtA[i] = 0x4a + } + if len(m.Params) > 0 { + for k := range m.Params { + v := m.Params[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + if m.Package != nil { + size, err := m.Package.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if len(m.OutputModule) > 0 { + i -= len(m.OutputModule) + copy(dAtA[i:], m.OutputModule) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OutputModule))) + i-- + dAtA[i] = 0x32 + } + if m.ProductionMode { + i-- + if m.ProductionMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.FinalBlocksOnly { + i-- + if m.FinalBlocksOnly { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.StopBlockNum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StopBlockNum)) + i-- + dAtA[i] = 0x18 + } + if len(m.StartCursor) > 0 { + i -= len(m.StartCursor) + copy(dAtA[i:], m.StartCursor) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StartCursor))) + i-- + dAtA[i] = 0x12 + } + if m.StartBlockNum != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartBlockNum)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Request) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartBlockNum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartBlockNum)) + } + l = len(m.StartCursor) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.StopBlockNum != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.StopBlockNum)) + } + if m.FinalBlocksOnly { + n += 2 + } + if m.ProductionMode { + n += 2 + } + l = len(m.OutputModule) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Package != nil { + l = m.Package.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Params) > 0 { + for k, v := range m.Params { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + l = len(m.Network) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.DebugInitialStoreSnapshotForModules) > 0 { + for _, s := range m.DebugInitialStoreSnapshotForModules { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.NoopMode { + n += 2 + } + if m.LimitProcessedBlocks != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LimitProcessedBlocks)) + } + if len(m.DevOutputModules) > 0 { + for _, s := range m.DevOutputModules { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.ProgressMessagesIntervalMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProgressMessagesIntervalMs)) + } + if m.PartialBlocks { + n += 3 + } + n += len(m.unknownFields) + return n +} + +func (m *Request) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Request: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBlockNum", wireType) + } + m.StartBlockNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBlockNum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartCursor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartCursor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StopBlockNum", wireType) + } + m.StopBlockNum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StopBlockNum |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalBlocksOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FinalBlocksOnly = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProductionMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ProductionMode = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputModule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutputModule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Package", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Package == nil { + m.Package = &v1.Package{} + } + if err := m.Package.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Params[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Network = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugInitialStoreSnapshotForModules", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DebugInitialStoreSnapshotForModules = append(m.DebugInitialStoreSnapshotForModules, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoopMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoopMode = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitProcessedBlocks", wireType) + } + m.LimitProcessedBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LimitProcessedBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DevOutputModules", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DevOutputModules = append(m.DevOutputModules, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProgressMessagesIntervalMs", wireType) + } + m.ProgressMessagesIntervalMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProgressMessagesIntervalMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PartialBlocks", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PartialBlocks = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/sink/service/v1/service_vtproto.pb.go b/pb/sf/substreams/sink/service/v1/service_vtproto.pb.go new file mode 100644 index 000000000..870479716 --- /dev/null +++ b/pb/sf/substreams/sink/service/v1/service_vtproto.pb.go @@ -0,0 +1,5017 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/sink/service/v1/service.proto + +package pbsinksvc + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + v1 "github.com/streamingfast/substreams/pb/sf/substreams/v1" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *DeployRequest) CloneVT() *DeployRequest { + if m == nil { + return (*DeployRequest)(nil) + } + r := new(DeployRequest) + r.SubstreamsPackage = m.SubstreamsPackage.CloneVT() + r.DevelopmentMode = m.DevelopmentMode + if rhs := m.Parameters; rhs != nil { + tmpContainer := make([]*Parameter, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Parameters = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *DeployRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Parameter) CloneVT() *Parameter { + if m == nil { + return (*Parameter)(nil) + } + r := new(Parameter) + r.Key = m.Key + r.Value = m.Value + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Parameter) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *DeployResponse) CloneVT() *DeployResponse { + if m == nil { + return (*DeployResponse)(nil) + } + r := new(DeployResponse) + r.Status = m.Status + r.DeploymentId = m.DeploymentId + r.Reason = m.Reason + r.Motd = m.Motd + if rhs := m.Services; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.Services = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *DeployResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UpdateRequest) CloneVT() *UpdateRequest { + if m == nil { + return (*UpdateRequest)(nil) + } + r := new(UpdateRequest) + r.SubstreamsPackage = m.SubstreamsPackage.CloneVT() + r.DeploymentId = m.DeploymentId + r.Reset_ = m.Reset_ + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UpdateRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *UpdateResponse) CloneVT() *UpdateResponse { + if m == nil { + return (*UpdateResponse)(nil) + } + r := new(UpdateResponse) + r.Status = m.Status + r.Reason = m.Reason + r.Motd = m.Motd + if rhs := m.Services; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.Services = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *UpdateResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *InfoRequest) CloneVT() *InfoRequest { + if m == nil { + return (*InfoRequest)(nil) + } + r := new(InfoRequest) + r.DeploymentId = m.DeploymentId + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InfoRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *InfoResponse) CloneVT() *InfoResponse { + if m == nil { + return (*InfoResponse)(nil) + } + r := new(InfoResponse) + r.Status = m.Status + r.Reason = m.Reason + r.PackageInfo = m.PackageInfo.CloneVT() + r.Progress = m.Progress.CloneVT() + r.Motd = m.Motd + if rhs := m.Services; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.Services = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InfoResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *SinkProgress) CloneVT() *SinkProgress { + if m == nil { + return (*SinkProgress)(nil) + } + r := new(SinkProgress) + r.LastProcessedBlock = m.LastProcessedBlock + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *SinkProgress) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *PackageInfo) CloneVT() *PackageInfo { + if m == nil { + return (*PackageInfo)(nil) + } + r := new(PackageInfo) + r.Name = m.Name + r.Version = m.Version + r.OutputModuleName = m.OutputModuleName + r.OutputModuleHash = m.OutputModuleHash + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *PackageInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ListRequest) CloneVT() *ListRequest { + if m == nil { + return (*ListRequest)(nil) + } + r := new(ListRequest) + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ListRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ListResponse) CloneVT() *ListResponse { + if m == nil { + return (*ListResponse)(nil) + } + r := new(ListResponse) + if rhs := m.Deployments; rhs != nil { + tmpContainer := make([]*DeploymentWithStatus, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Deployments = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ListResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *DeploymentWithStatus) CloneVT() *DeploymentWithStatus { + if m == nil { + return (*DeploymentWithStatus)(nil) + } + r := new(DeploymentWithStatus) + r.Id = m.Id + r.Status = m.Status + r.Reason = m.Reason + r.PackageInfo = m.PackageInfo.CloneVT() + r.Progress = m.Progress.CloneVT() + r.Motd = m.Motd + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *DeploymentWithStatus) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RemoveRequest) CloneVT() *RemoveRequest { + if m == nil { + return (*RemoveRequest)(nil) + } + r := new(RemoveRequest) + r.DeploymentId = m.DeploymentId + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *RemoveRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *RemoveResponse) CloneVT() *RemoveResponse { + if m == nil { + return (*RemoveResponse)(nil) + } + r := new(RemoveResponse) + r.PreviousStatus = m.PreviousStatus + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *RemoveResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *PauseRequest) CloneVT() *PauseRequest { + if m == nil { + return (*PauseRequest)(nil) + } + r := new(PauseRequest) + r.DeploymentId = m.DeploymentId + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *PauseRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *PauseResponse) CloneVT() *PauseResponse { + if m == nil { + return (*PauseResponse)(nil) + } + r := new(PauseResponse) + r.PreviousStatus = m.PreviousStatus + r.NewStatus = m.NewStatus + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *PauseResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StopRequest) CloneVT() *StopRequest { + if m == nil { + return (*StopRequest)(nil) + } + r := new(StopRequest) + r.DeploymentId = m.DeploymentId + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StopRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StopResponse) CloneVT() *StopResponse { + if m == nil { + return (*StopResponse)(nil) + } + r := new(StopResponse) + r.PreviousStatus = m.PreviousStatus + r.NewStatus = m.NewStatus + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StopResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ResumeRequest) CloneVT() *ResumeRequest { + if m == nil { + return (*ResumeRequest)(nil) + } + r := new(ResumeRequest) + r.DeploymentId = m.DeploymentId + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ResumeRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ResumeResponse) CloneVT() *ResumeResponse { + if m == nil { + return (*ResumeResponse)(nil) + } + r := new(ResumeResponse) + r.PreviousStatus = m.PreviousStatus + r.NewStatus = m.NewStatus + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ResumeResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *DeployRequest) EqualVT(that *DeployRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.SubstreamsPackage.EqualVT(that.SubstreamsPackage) { + return false + } + if this.DevelopmentMode != that.DevelopmentMode { + return false + } + if len(this.Parameters) != len(that.Parameters) { + return false + } + for i, vx := range this.Parameters { + vy := that.Parameters[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Parameter{} + } + if q == nil { + q = &Parameter{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *DeployRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*DeployRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Parameter) EqualVT(that *Parameter) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Key != that.Key { + return false + } + if this.Value != that.Value { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Parameter) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Parameter) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *DeployResponse) EqualVT(that *DeployResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Status != that.Status { + return false + } + if this.DeploymentId != that.DeploymentId { + return false + } + if len(this.Services) != len(that.Services) { + return false + } + for i, vx := range this.Services { + vy, ok := that.Services[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + if this.Reason != that.Reason { + return false + } + if this.Motd != that.Motd { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *DeployResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*DeployResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UpdateRequest) EqualVT(that *UpdateRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !this.SubstreamsPackage.EqualVT(that.SubstreamsPackage) { + return false + } + if this.DeploymentId != that.DeploymentId { + return false + } + if this.Reset_ != that.Reset_ { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UpdateRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UpdateRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *UpdateResponse) EqualVT(that *UpdateResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Status != that.Status { + return false + } + if len(this.Services) != len(that.Services) { + return false + } + for i, vx := range this.Services { + vy, ok := that.Services[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + if this.Reason != that.Reason { + return false + } + if this.Motd != that.Motd { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UpdateResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*UpdateResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *InfoRequest) EqualVT(that *InfoRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.DeploymentId != that.DeploymentId { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InfoRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfoRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *InfoResponse) EqualVT(that *InfoResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Status != that.Status { + return false + } + if len(this.Services) != len(that.Services) { + return false + } + for i, vx := range this.Services { + vy, ok := that.Services[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + if this.Reason != that.Reason { + return false + } + if !this.PackageInfo.EqualVT(that.PackageInfo) { + return false + } + if !this.Progress.EqualVT(that.Progress) { + return false + } + if this.Motd != that.Motd { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InfoResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfoResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *SinkProgress) EqualVT(that *SinkProgress) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.LastProcessedBlock != that.LastProcessedBlock { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *SinkProgress) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*SinkProgress) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *PackageInfo) EqualVT(that *PackageInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Version != that.Version { + return false + } + if this.OutputModuleName != that.OutputModuleName { + return false + } + if this.OutputModuleHash != that.OutputModuleHash { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *PackageInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*PackageInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ListRequest) EqualVT(that *ListRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ListRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ListRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ListResponse) EqualVT(that *ListResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Deployments) != len(that.Deployments) { + return false + } + for i, vx := range this.Deployments { + vy := that.Deployments[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &DeploymentWithStatus{} + } + if q == nil { + q = &DeploymentWithStatus{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ListResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ListResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *DeploymentWithStatus) EqualVT(that *DeploymentWithStatus) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if this.Status != that.Status { + return false + } + if this.Reason != that.Reason { + return false + } + if !this.PackageInfo.EqualVT(that.PackageInfo) { + return false + } + if !this.Progress.EqualVT(that.Progress) { + return false + } + if this.Motd != that.Motd { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *DeploymentWithStatus) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*DeploymentWithStatus) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RemoveRequest) EqualVT(that *RemoveRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.DeploymentId != that.DeploymentId { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *RemoveRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RemoveRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *RemoveResponse) EqualVT(that *RemoveResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PreviousStatus != that.PreviousStatus { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *RemoveResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*RemoveResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *PauseRequest) EqualVT(that *PauseRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.DeploymentId != that.DeploymentId { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *PauseRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*PauseRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *PauseResponse) EqualVT(that *PauseResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PreviousStatus != that.PreviousStatus { + return false + } + if this.NewStatus != that.NewStatus { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *PauseResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*PauseResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *StopRequest) EqualVT(that *StopRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.DeploymentId != that.DeploymentId { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StopRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StopRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *StopResponse) EqualVT(that *StopResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PreviousStatus != that.PreviousStatus { + return false + } + if this.NewStatus != that.NewStatus { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StopResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StopResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ResumeRequest) EqualVT(that *ResumeRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.DeploymentId != that.DeploymentId { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ResumeRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ResumeRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ResumeResponse) EqualVT(that *ResumeResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PreviousStatus != that.PreviousStatus { + return false + } + if this.NewStatus != that.NewStatus { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ResumeResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ResumeResponse) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *DeployRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeployRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *DeployRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Parameters) > 0 { + for iNdEx := len(m.Parameters) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Parameters[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if m.DevelopmentMode { + i-- + if m.DevelopmentMode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.SubstreamsPackage != nil { + size, err := m.SubstreamsPackage.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Parameter) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Parameter) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Parameter) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DeployResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeployResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *DeployResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Motd) > 0 { + i -= len(m.Motd) + copy(dAtA[i:], m.Motd) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Motd))) + i-- + dAtA[i] = 0x2a + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x22 + } + if len(m.Services) > 0 { + for k := range m.Services { + v := m.Services[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.DeploymentId) > 0 { + i -= len(m.DeploymentId) + copy(dAtA[i:], m.DeploymentId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeploymentId))) + i-- + dAtA[i] = 0x12 + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UpdateRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Reset_ { + i-- + if m.Reset_ { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.DeploymentId) > 0 { + i -= len(m.DeploymentId) + copy(dAtA[i:], m.DeploymentId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeploymentId))) + i-- + dAtA[i] = 0x12 + } + if m.SubstreamsPackage != nil { + size, err := m.SubstreamsPackage.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Motd) > 0 { + i -= len(m.Motd) + copy(dAtA[i:], m.Motd) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Motd))) + i-- + dAtA[i] = 0x22 + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x1a + } + if len(m.Services) > 0 { + for k := range m.Services { + v := m.Services[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *InfoRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfoRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfoRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DeploymentId) > 0 { + i -= len(m.DeploymentId) + copy(dAtA[i:], m.DeploymentId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeploymentId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InfoResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfoResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfoResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Motd) > 0 { + i -= len(m.Motd) + copy(dAtA[i:], m.Motd) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Motd))) + i-- + dAtA[i] = 0x32 + } + if m.Progress != nil { + size, err := m.Progress.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.PackageInfo != nil { + size, err := m.PackageInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x1a + } + if len(m.Services) > 0 { + for k := range m.Services { + v := m.Services[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SinkProgress) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SinkProgress) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SinkProgress) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.LastProcessedBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LastProcessedBlock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PackageInfo) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PackageInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PackageInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.OutputModuleHash) > 0 { + i -= len(m.OutputModuleHash) + copy(dAtA[i:], m.OutputModuleHash) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OutputModuleHash))) + i-- + dAtA[i] = 0x22 + } + if len(m.OutputModuleName) > 0 { + i -= len(m.OutputModuleName) + copy(dAtA[i:], m.OutputModuleName) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OutputModuleName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ListRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *ListResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ListResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Deployments) > 0 { + for iNdEx := len(m.Deployments) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Deployments[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DeploymentWithStatus) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DeploymentWithStatus) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *DeploymentWithStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Motd) > 0 { + i -= len(m.Motd) + copy(dAtA[i:], m.Motd) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Motd))) + i-- + dAtA[i] = 0x32 + } + if m.Progress != nil { + size, err := m.Progress.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.PackageInfo != nil { + size, err := m.PackageInfo.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x1a + } + if m.Status != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RemoveRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DeploymentId) > 0 { + i -= len(m.DeploymentId) + copy(dAtA[i:], m.DeploymentId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeploymentId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RemoveResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.PreviousStatus != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PreviousStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PauseRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PauseRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PauseRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DeploymentId) > 0 { + i -= len(m.DeploymentId) + copy(dAtA[i:], m.DeploymentId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeploymentId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PauseResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PauseResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PauseResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.NewStatus != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NewStatus)) + i-- + dAtA[i] = 0x10 + } + if m.PreviousStatus != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PreviousStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StopRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StopRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DeploymentId) > 0 { + i -= len(m.DeploymentId) + copy(dAtA[i:], m.DeploymentId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeploymentId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StopResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StopResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.NewStatus != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NewStatus)) + i-- + dAtA[i] = 0x10 + } + if m.PreviousStatus != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PreviousStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ResumeRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResumeRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ResumeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.DeploymentId) > 0 { + i -= len(m.DeploymentId) + copy(dAtA[i:], m.DeploymentId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DeploymentId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ResumeResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResumeResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ResumeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.NewStatus != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NewStatus)) + i-- + dAtA[i] = 0x10 + } + if m.PreviousStatus != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PreviousStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DeployRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SubstreamsPackage != nil { + l = m.SubstreamsPackage.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DevelopmentMode { + n += 2 + } + if len(m.Parameters) > 0 { + for _, e := range m.Parameters { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Parameter) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *DeployResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + l = len(m.DeploymentId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Services) > 0 { + for k, v := range m.Services { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Motd) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SubstreamsPackage != nil { + l = m.SubstreamsPackage.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.DeploymentId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Reset_ { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + if len(m.Services) > 0 { + for k, v := range m.Services { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Motd) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *InfoRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DeploymentId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *InfoResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + if len(m.Services) > 0 { + for k, v := range m.Services { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.PackageInfo != nil { + l = m.PackageInfo.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Progress != nil { + l = m.Progress.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Motd) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *SinkProgress) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LastProcessedBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.LastProcessedBlock)) + } + n += len(m.unknownFields) + return n +} + +func (m *PackageInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.OutputModuleName) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.OutputModuleHash) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ListRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *ListResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deployments) > 0 { + for _, e := range m.Deployments { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *DeploymentWithStatus) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Status != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.PackageInfo != nil { + l = m.PackageInfo.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Progress != nil { + l = m.Progress.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Motd) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *RemoveRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DeploymentId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *RemoveResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PreviousStatus != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PreviousStatus)) + } + n += len(m.unknownFields) + return n +} + +func (m *PauseRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DeploymentId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *PauseResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PreviousStatus != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PreviousStatus)) + } + if m.NewStatus != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.NewStatus)) + } + n += len(m.unknownFields) + return n +} + +func (m *StopRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DeploymentId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StopResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PreviousStatus != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PreviousStatus)) + } + if m.NewStatus != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.NewStatus)) + } + n += len(m.unknownFields) + return n +} + +func (m *ResumeRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DeploymentId) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ResumeResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PreviousStatus != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PreviousStatus)) + } + if m.NewStatus != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.NewStatus)) + } + n += len(m.unknownFields) + return n +} + +func (m *DeployRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: DeployRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeployRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubstreamsPackage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SubstreamsPackage == nil { + m.SubstreamsPackage = &v1.Package{} + } + if err := m.SubstreamsPackage.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DevelopmentMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DevelopmentMode = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Parameters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Parameters = append(m.Parameters, &Parameter{}) + if err := m.Parameters[len(m.Parameters)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Parameter) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Parameter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Parameter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeployResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: DeployResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeployResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeploymentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Services == nil { + m.Services = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Services[mapkey] = mapvalue + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Motd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Motd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UpdateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubstreamsPackage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SubstreamsPackage == nil { + m.SubstreamsPackage = &v1.Package{} + } + if err := m.SubstreamsPackage.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeploymentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reset_", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Reset_ = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: UpdateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Services == nil { + m.Services = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Services[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Motd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Motd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfoRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: InfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeploymentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfoResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: InfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Services == nil { + m.Services = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Services[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PackageInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PackageInfo == nil { + m.PackageInfo = &PackageInfo{} + } + if err := m.PackageInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Progress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Progress == nil { + m.Progress = &SinkProgress{} + } + if err := m.Progress.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Motd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Motd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SinkProgress) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: SinkProgress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SinkProgress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastProcessedBlock", wireType) + } + m.LastProcessedBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastProcessedBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PackageInfo) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: PackageInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PackageInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputModuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutputModuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputModuleHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutputModuleHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ListRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ListResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deployments", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deployments = append(m.Deployments, &DeploymentWithStatus{}) + if err := m.Deployments[len(m.Deployments)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeploymentWithStatus) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: DeploymentWithStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeploymentWithStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PackageInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PackageInfo == nil { + m.PackageInfo = &PackageInfo{} + } + if err := m.PackageInfo.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Progress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Progress == nil { + m.Progress = &SinkProgress{} + } + if err := m.Progress.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Motd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Motd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: RemoveRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeploymentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: RemoveResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousStatus", wireType) + } + m.PreviousStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PreviousStatus |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PauseRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: PauseRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PauseRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeploymentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PauseResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: PauseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PauseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousStatus", wireType) + } + m.PreviousStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PreviousStatus |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewStatus", wireType) + } + m.NewStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewStatus |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: StopRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeploymentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: StopResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousStatus", wireType) + } + m.PreviousStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PreviousStatus |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewStatus", wireType) + } + m.NewStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewStatus |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResumeRequest) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ResumeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResumeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeploymentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeploymentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResumeResponse) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ResumeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResumeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousStatus", wireType) + } + m.PreviousStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PreviousStatus |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewStatus", wireType) + } + m.NewStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewStatus |= DeploymentStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/v1/clock_vtproto.pb.go b/pb/sf/substreams/v1/clock_vtproto.pb.go new file mode 100644 index 000000000..0412c1050 --- /dev/null +++ b/pb/sf/substreams/v1/clock_vtproto.pb.go @@ -0,0 +1,485 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/v1/clock.proto + +package pbsubstreams + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + timestamppb1 "github.com/planetscale/vtprotobuf/types/known/timestamppb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" +) + +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) +) + +func (m *Clock) CloneVT() *Clock { + if m == nil { + return (*Clock)(nil) + } + r := new(Clock) + r.Id = m.Id + r.Number = m.Number + r.Timestamp = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.Timestamp).CloneVT()) + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Clock) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *BlockRef) CloneVT() *BlockRef { + if m == nil { + return (*BlockRef)(nil) + } + r := new(BlockRef) + r.Id = m.Id + r.Number = m.Number + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockRef) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Clock) EqualVT(that *Clock) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if this.Number != that.Number { + return false + } + if !(*timestamppb1.Timestamp)(this.Timestamp).EqualVT((*timestamppb1.Timestamp)(that.Timestamp)) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Clock) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Clock) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *BlockRef) EqualVT(that *BlockRef) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if this.Number != that.Number { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockRef) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockRef) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Clock) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Clock) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Clock) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Timestamp != nil { + size, err := (*timestamppb1.Timestamp)(m.Timestamp).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Number != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockRef) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockRef) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockRef) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Number != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Clock) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Number != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Number)) + } + if m.Timestamp != nil { + l = (*timestamppb1.Timestamp)(m.Timestamp).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *BlockRef) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Number != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Number)) + } + n += len(m.unknownFields) + return n +} + +func (m *Clock) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Clock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Clock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = ×tamppb.Timestamp{} + } + if err := (*timestamppb1.Timestamp)(m.Timestamp).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockRef) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockRef: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockRef: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/v1/deltas_vtproto.pb.go b/pb/sf/substreams/v1/deltas_vtproto.pb.go new file mode 100644 index 000000000..48b303227 --- /dev/null +++ b/pb/sf/substreams/v1/deltas_vtproto.pb.go @@ -0,0 +1,564 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/v1/deltas.proto + +package pbsubstreams + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *StoreDeltas) CloneVT() *StoreDeltas { + if m == nil { + return (*StoreDeltas)(nil) + } + r := new(StoreDeltas) + if rhs := m.StoreDeltas; rhs != nil { + tmpContainer := make([]*StoreDelta, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.StoreDeltas = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StoreDeltas) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *StoreDelta) CloneVT() *StoreDelta { + if m == nil { + return (*StoreDelta)(nil) + } + r := new(StoreDelta) + r.Operation = m.Operation + r.Ordinal = m.Ordinal + r.Key = m.Key + if rhs := m.OldValue; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.OldValue = tmpBytes + } + if rhs := m.NewValue; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.NewValue = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *StoreDelta) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *StoreDeltas) EqualVT(that *StoreDeltas) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.StoreDeltas) != len(that.StoreDeltas) { + return false + } + for i, vx := range this.StoreDeltas { + vy := that.StoreDeltas[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &StoreDelta{} + } + if q == nil { + q = &StoreDelta{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StoreDeltas) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StoreDeltas) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *StoreDelta) EqualVT(that *StoreDelta) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Operation != that.Operation { + return false + } + if this.Ordinal != that.Ordinal { + return false + } + if this.Key != that.Key { + return false + } + if string(this.OldValue) != string(that.OldValue) { + return false + } + if string(this.NewValue) != string(that.NewValue) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StoreDelta) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*StoreDelta) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *StoreDeltas) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreDeltas) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StoreDeltas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.StoreDeltas) > 0 { + for iNdEx := len(m.StoreDeltas) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.StoreDeltas[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StoreDelta) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreDelta) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StoreDelta) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.NewValue) > 0 { + i -= len(m.NewValue) + copy(dAtA[i:], m.NewValue) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.NewValue))) + i-- + dAtA[i] = 0x2a + } + if len(m.OldValue) > 0 { + i -= len(m.OldValue) + copy(dAtA[i:], m.OldValue) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OldValue))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if m.Ordinal != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Ordinal)) + i-- + dAtA[i] = 0x10 + } + if m.Operation != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Operation)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StoreDeltas) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.StoreDeltas) > 0 { + for _, e := range m.StoreDeltas { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *StoreDelta) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Operation != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Operation)) + } + if m.Ordinal != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Ordinal)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.OldValue) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.NewValue) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StoreDeltas) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: StoreDeltas: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreDeltas: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreDeltas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StoreDeltas = append(m.StoreDeltas, &StoreDelta{}) + if err := m.StoreDeltas[len(m.StoreDeltas)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StoreDelta) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: StoreDelta: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreDelta: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + m.Operation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Operation |= StoreDelta_Operation(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ordinal", wireType) + } + m.Ordinal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ordinal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldValue", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OldValue = append(m.OldValue[:0], dAtA[iNdEx:postIndex]...) + if m.OldValue == nil { + m.OldValue = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewValue", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewValue = append(m.NewValue[:0], dAtA[iNdEx:postIndex]...) + if m.NewValue == nil { + m.NewValue = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/v1/modules_vtproto.pb.go b/pb/sf/substreams/v1/modules_vtproto.pb.go new file mode 100644 index 000000000..47db9b0e7 --- /dev/null +++ b/pb/sf/substreams/v1/modules_vtproto.pb.go @@ -0,0 +1,4152 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/v1/modules.proto + +package pbsubstreams + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *Modules) CloneVT() *Modules { + if m == nil { + return (*Modules)(nil) + } + r := new(Modules) + if rhs := m.Modules; rhs != nil { + tmpContainer := make([]*Module, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Modules = tmpContainer + } + if rhs := m.Binaries; rhs != nil { + tmpContainer := make([]*Binary, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Binaries = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Modules) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Binary) CloneVT() *Binary { + if m == nil { + return (*Binary)(nil) + } + r := new(Binary) + r.Type = m.Type + if rhs := m.Content; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Content = tmpBytes + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Binary) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_BlockFilter) CloneVT() *Module_BlockFilter { + if m == nil { + return (*Module_BlockFilter)(nil) + } + r := new(Module_BlockFilter) + r.Module = m.Module + if m.Query != nil { + r.Query = m.Query.(interface { + CloneVT() isModule_BlockFilter_Query + }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_BlockFilter) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_BlockFilter_QueryString) CloneVT() isModule_BlockFilter_Query { + if m == nil { + return (*Module_BlockFilter_QueryString)(nil) + } + r := new(Module_BlockFilter_QueryString) + r.QueryString = m.QueryString + return r +} + +func (m *Module_BlockFilter_QueryFromParams) CloneVT() isModule_BlockFilter_Query { + if m == nil { + return (*Module_BlockFilter_QueryFromParams)(nil) + } + r := new(Module_BlockFilter_QueryFromParams) + r.QueryFromParams = m.QueryFromParams.CloneVT() + return r +} + +func (m *Module_QueryFromParams) CloneVT() *Module_QueryFromParams { + if m == nil { + return (*Module_QueryFromParams)(nil) + } + r := new(Module_QueryFromParams) + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_QueryFromParams) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_KindMap) CloneVT() *Module_KindMap { + if m == nil { + return (*Module_KindMap)(nil) + } + r := new(Module_KindMap) + r.OutputType = m.OutputType + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_KindMap) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_KindStore) CloneVT() *Module_KindStore { + if m == nil { + return (*Module_KindStore)(nil) + } + r := new(Module_KindStore) + r.UpdatePolicy = m.UpdatePolicy + r.ValueType = m.ValueType + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_KindStore) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_KindBlockIndex) CloneVT() *Module_KindBlockIndex { + if m == nil { + return (*Module_KindBlockIndex)(nil) + } + r := new(Module_KindBlockIndex) + r.OutputType = m.OutputType + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_KindBlockIndex) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_FoundationalStore) CloneVT() *Module_FoundationalStore { + if m == nil { + return (*Module_FoundationalStore)(nil) + } + r := new(Module_FoundationalStore) + r.Identifier = m.Identifier + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_FoundationalStore) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_Input_Source) CloneVT() *Module_Input_Source { + if m == nil { + return (*Module_Input_Source)(nil) + } + r := new(Module_Input_Source) + r.Type = m.Type + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_Input_Source) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_Input_Map) CloneVT() *Module_Input_Map { + if m == nil { + return (*Module_Input_Map)(nil) + } + r := new(Module_Input_Map) + r.ModuleName = m.ModuleName + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_Input_Map) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_Input_Store) CloneVT() *Module_Input_Store { + if m == nil { + return (*Module_Input_Store)(nil) + } + r := new(Module_Input_Store) + r.ModuleName = m.ModuleName + r.Mode = m.Mode + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_Input_Store) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_Input_Params) CloneVT() *Module_Input_Params { + if m == nil { + return (*Module_Input_Params)(nil) + } + r := new(Module_Input_Params) + r.Value = m.Value + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_Input_Params) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_Input) CloneVT() *Module_Input { + if m == nil { + return (*Module_Input)(nil) + } + r := new(Module_Input) + if m.Input != nil { + r.Input = m.Input.(interface{ CloneVT() isModule_Input_Input }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_Input) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_Input_Source_) CloneVT() isModule_Input_Input { + if m == nil { + return (*Module_Input_Source_)(nil) + } + r := new(Module_Input_Source_) + r.Source = m.Source.CloneVT() + return r +} + +func (m *Module_Input_Map_) CloneVT() isModule_Input_Input { + if m == nil { + return (*Module_Input_Map_)(nil) + } + r := new(Module_Input_Map_) + r.Map = m.Map.CloneVT() + return r +} + +func (m *Module_Input_Store_) CloneVT() isModule_Input_Input { + if m == nil { + return (*Module_Input_Store_)(nil) + } + r := new(Module_Input_Store_) + r.Store = m.Store.CloneVT() + return r +} + +func (m *Module_Input_Params_) CloneVT() isModule_Input_Input { + if m == nil { + return (*Module_Input_Params_)(nil) + } + r := new(Module_Input_Params_) + r.Params = m.Params.CloneVT() + return r +} + +func (m *Module_Input_FoundationalStore) CloneVT() isModule_Input_Input { + if m == nil { + return (*Module_Input_FoundationalStore)(nil) + } + r := new(Module_Input_FoundationalStore) + r.FoundationalStore = m.FoundationalStore.CloneVT() + return r +} + +func (m *Module_Output) CloneVT() *Module_Output { + if m == nil { + return (*Module_Output)(nil) + } + r := new(Module_Output) + r.Type = m.Type + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module_Output) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module) CloneVT() *Module { + if m == nil { + return (*Module)(nil) + } + r := new(Module) + r.Name = m.Name + r.BinaryIndex = m.BinaryIndex + r.BinaryEntrypoint = m.BinaryEntrypoint + r.Output = m.Output.CloneVT() + r.InitialBlock = m.InitialBlock + r.BlockFilter = m.BlockFilter.CloneVT() + if m.Kind != nil { + r.Kind = m.Kind.(interface{ CloneVT() isModule_Kind }).CloneVT() + } + if rhs := m.Inputs; rhs != nil { + tmpContainer := make([]*Module_Input, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Inputs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Module) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Module_KindMap_) CloneVT() isModule_Kind { + if m == nil { + return (*Module_KindMap_)(nil) + } + r := new(Module_KindMap_) + r.KindMap = m.KindMap.CloneVT() + return r +} + +func (m *Module_KindStore_) CloneVT() isModule_Kind { + if m == nil { + return (*Module_KindStore_)(nil) + } + r := new(Module_KindStore_) + r.KindStore = m.KindStore.CloneVT() + return r +} + +func (m *Module_KindBlockIndex_) CloneVT() isModule_Kind { + if m == nil { + return (*Module_KindBlockIndex_)(nil) + } + r := new(Module_KindBlockIndex_) + r.KindBlockIndex = m.KindBlockIndex.CloneVT() + return r +} + +func (this *Modules) EqualVT(that *Modules) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Modules) != len(that.Modules) { + return false + } + for i, vx := range this.Modules { + vy := that.Modules[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Module{} + } + if q == nil { + q = &Module{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.Binaries) != len(that.Binaries) { + return false + } + for i, vx := range this.Binaries { + vy := that.Binaries[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Binary{} + } + if q == nil { + q = &Binary{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Modules) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Modules) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Binary) EqualVT(that *Binary) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + if string(this.Content) != string(that.Content) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Binary) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Binary) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_BlockFilter) EqualVT(that *Module_BlockFilter) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Query == nil && that.Query != nil { + return false + } else if this.Query != nil { + if that.Query == nil { + return false + } + if !this.Query.(interface { + EqualVT(isModule_BlockFilter_Query) bool + }).EqualVT(that.Query) { + return false + } + } + if this.Module != that.Module { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_BlockFilter) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_BlockFilter) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_BlockFilter_QueryString) EqualVT(thatIface isModule_BlockFilter_Query) bool { + that, ok := thatIface.(*Module_BlockFilter_QueryString) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.QueryString != that.QueryString { + return false + } + return true +} + +func (this *Module_BlockFilter_QueryFromParams) EqualVT(thatIface isModule_BlockFilter_Query) bool { + that, ok := thatIface.(*Module_BlockFilter_QueryFromParams) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.QueryFromParams, that.QueryFromParams; p != q { + if p == nil { + p = &Module_QueryFromParams{} + } + if q == nil { + q = &Module_QueryFromParams{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_QueryFromParams) EqualVT(that *Module_QueryFromParams) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_QueryFromParams) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_QueryFromParams) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_KindMap) EqualVT(that *Module_KindMap) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.OutputType != that.OutputType { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_KindMap) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_KindMap) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_KindStore) EqualVT(that *Module_KindStore) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.UpdatePolicy != that.UpdatePolicy { + return false + } + if this.ValueType != that.ValueType { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_KindStore) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_KindStore) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_KindBlockIndex) EqualVT(that *Module_KindBlockIndex) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.OutputType != that.OutputType { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_KindBlockIndex) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_KindBlockIndex) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_FoundationalStore) EqualVT(that *Module_FoundationalStore) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Identifier != that.Identifier { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_FoundationalStore) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_FoundationalStore) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_Input_Source) EqualVT(that *Module_Input_Source) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_Input_Source) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_Input_Source) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_Input_Map) EqualVT(that *Module_Input_Map) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.ModuleName != that.ModuleName { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_Input_Map) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_Input_Map) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_Input_Store) EqualVT(that *Module_Input_Store) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.ModuleName != that.ModuleName { + return false + } + if this.Mode != that.Mode { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_Input_Store) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_Input_Store) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_Input_Params) EqualVT(that *Module_Input_Params) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Value != that.Value { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_Input_Params) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_Input_Params) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_Input) EqualVT(that *Module_Input) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Input == nil && that.Input != nil { + return false + } else if this.Input != nil { + if that.Input == nil { + return false + } + if !this.Input.(interface { + EqualVT(isModule_Input_Input) bool + }).EqualVT(that.Input) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_Input) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_Input) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_Input_Source_) EqualVT(thatIface isModule_Input_Input) bool { + that, ok := thatIface.(*Module_Input_Source_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Source, that.Source; p != q { + if p == nil { + p = &Module_Input_Source{} + } + if q == nil { + q = &Module_Input_Source{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_Input_Map_) EqualVT(thatIface isModule_Input_Input) bool { + that, ok := thatIface.(*Module_Input_Map_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Map, that.Map; p != q { + if p == nil { + p = &Module_Input_Map{} + } + if q == nil { + q = &Module_Input_Map{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_Input_Store_) EqualVT(thatIface isModule_Input_Input) bool { + that, ok := thatIface.(*Module_Input_Store_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Store, that.Store; p != q { + if p == nil { + p = &Module_Input_Store{} + } + if q == nil { + q = &Module_Input_Store{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_Input_Params_) EqualVT(thatIface isModule_Input_Input) bool { + that, ok := thatIface.(*Module_Input_Params_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Params, that.Params; p != q { + if p == nil { + p = &Module_Input_Params{} + } + if q == nil { + q = &Module_Input_Params{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_Input_FoundationalStore) EqualVT(thatIface isModule_Input_Input) bool { + that, ok := thatIface.(*Module_Input_FoundationalStore) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.FoundationalStore, that.FoundationalStore; p != q { + if p == nil { + p = &Module_FoundationalStore{} + } + if q == nil { + q = &Module_FoundationalStore{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_Output) EqualVT(that *Module_Output) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Type != that.Type { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module_Output) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module_Output) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module) EqualVT(that *Module) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Kind == nil && that.Kind != nil { + return false + } else if this.Kind != nil { + if that.Kind == nil { + return false + } + if !this.Kind.(interface{ EqualVT(isModule_Kind) bool }).EqualVT(that.Kind) { + return false + } + } + if this.Name != that.Name { + return false + } + if this.BinaryIndex != that.BinaryIndex { + return false + } + if this.BinaryEntrypoint != that.BinaryEntrypoint { + return false + } + if len(this.Inputs) != len(that.Inputs) { + return false + } + for i, vx := range this.Inputs { + vy := that.Inputs[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &Module_Input{} + } + if q == nil { + q = &Module_Input{} + } + if !p.EqualVT(q) { + return false + } + } + } + if !this.Output.EqualVT(that.Output) { + return false + } + if this.InitialBlock != that.InitialBlock { + return false + } + if !this.BlockFilter.EqualVT(that.BlockFilter) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Module) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Module) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Module_KindMap_) EqualVT(thatIface isModule_Kind) bool { + that, ok := thatIface.(*Module_KindMap_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.KindMap, that.KindMap; p != q { + if p == nil { + p = &Module_KindMap{} + } + if q == nil { + q = &Module_KindMap{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_KindStore_) EqualVT(thatIface isModule_Kind) bool { + that, ok := thatIface.(*Module_KindStore_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.KindStore, that.KindStore; p != q { + if p == nil { + p = &Module_KindStore{} + } + if q == nil { + q = &Module_KindStore{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Module_KindBlockIndex_) EqualVT(thatIface isModule_Kind) bool { + that, ok := thatIface.(*Module_KindBlockIndex_) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.KindBlockIndex, that.KindBlockIndex; p != q { + if p == nil { + p = &Module_KindBlockIndex{} + } + if q == nil { + q = &Module_KindBlockIndex{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (m *Modules) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Modules) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Modules) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Binaries) > 0 { + for iNdEx := len(m.Binaries) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Binaries[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Modules) > 0 { + for iNdEx := len(m.Modules) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Modules[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Binary) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Binary) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Binary) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Content) > 0 { + i -= len(m.Content) + copy(dAtA[i:], m.Content) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Content))) + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_BlockFilter) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_BlockFilter) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_BlockFilter) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Query.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_BlockFilter_QueryString) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_BlockFilter_QueryString) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.QueryString) + copy(dAtA[i:], m.QueryString) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.QueryString))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *Module_BlockFilter_QueryFromParams) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_BlockFilter_QueryFromParams) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.QueryFromParams != nil { + size, err := m.QueryFromParams.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Module_QueryFromParams) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_QueryFromParams) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_QueryFromParams) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *Module_KindMap) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_KindMap) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_KindMap) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.OutputType) > 0 { + i -= len(m.OutputType) + copy(dAtA[i:], m.OutputType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OutputType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_KindStore) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_KindStore) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_KindStore) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.ValueType) > 0 { + i -= len(m.ValueType) + copy(dAtA[i:], m.ValueType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ValueType))) + i-- + dAtA[i] = 0x12 + } + if m.UpdatePolicy != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UpdatePolicy)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Module_KindBlockIndex) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_KindBlockIndex) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_KindBlockIndex) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.OutputType) > 0 { + i -= len(m.OutputType) + copy(dAtA[i:], m.OutputType) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OutputType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_FoundationalStore) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_FoundationalStore) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_FoundationalStore) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_Input_Source) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_Input_Source) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Source) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_Input_Map) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_Input_Map) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Map) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.ModuleName) > 0 { + i -= len(m.ModuleName) + copy(dAtA[i:], m.ModuleName) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ModuleName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_Input_Store) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_Input_Store) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Store) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Mode != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 + } + if len(m.ModuleName) > 0 { + i -= len(m.ModuleName) + copy(dAtA[i:], m.ModuleName) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ModuleName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_Input_Params) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_Input_Params) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Params) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_Input) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_Input) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Input.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *Module_Input_Source_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Source_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Source != nil { + size, err := m.Source.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Module_Input_Map_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Map_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Map != nil { + size, err := m.Map.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Module_Input_Store_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Store_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Store != nil { + size, err := m.Store.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Module_Input_Params_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_Params_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Params != nil { + size, err := m.Params.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Module_Input_FoundationalStore) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Input_FoundationalStore) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FoundationalStore != nil { + size, err := m.FoundationalStore.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Module_Output) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module_Output) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_Output) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Module) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Kind.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if m.BlockFilter != nil { + size, err := m.BlockFilter.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } + if m.InitialBlock != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.InitialBlock)) + i-- + dAtA[i] = 0x40 + } + if m.Output != nil { + size, err := m.Output.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if len(m.Inputs) > 0 { + for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Inputs[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.BinaryEntrypoint) > 0 { + i -= len(m.BinaryEntrypoint) + copy(dAtA[i:], m.BinaryEntrypoint) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BinaryEntrypoint))) + i-- + dAtA[i] = 0x2a + } + if m.BinaryIndex != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BinaryIndex)) + i-- + dAtA[i] = 0x20 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module_KindMap_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_KindMap_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.KindMap != nil { + size, err := m.KindMap.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Module_KindStore_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_KindStore_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.KindStore != nil { + size, err := m.KindStore.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Module_KindBlockIndex_) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Module_KindBlockIndex_) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.KindBlockIndex != nil { + size, err := m.KindBlockIndex.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + return len(dAtA) - i, nil +} +func (m *Modules) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Modules) > 0 { + for _, e := range m.Modules { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.Binaries) > 0 { + for _, e := range m.Binaries { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Binary) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Content) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_BlockFilter) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if vtmsg, ok := m.Query.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *Module_BlockFilter_QueryString) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.QueryString) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + return n +} +func (m *Module_BlockFilter_QueryFromParams) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.QueryFromParams != nil { + l = m.QueryFromParams.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_QueryFromParams) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *Module_KindMap) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OutputType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_KindStore) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UpdatePolicy != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.UpdatePolicy)) + } + l = len(m.ValueType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_KindBlockIndex) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OutputType) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_FoundationalStore) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Identifier) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_Input_Source) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_Input_Map) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ModuleName) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_Input_Store) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ModuleName) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Mode != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Mode)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_Input_Params) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_Input) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Input.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *Module_Input_Source_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Source != nil { + l = m.Source.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_Input_Map_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Map != nil { + l = m.Map.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_Input_Store_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Store != nil { + l = m.Store.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_Input_Params_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_Input_FoundationalStore) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FoundationalStore != nil { + l = m.FoundationalStore.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_Output) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if vtmsg, ok := m.Kind.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if m.BinaryIndex != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.BinaryIndex)) + } + l = len(m.BinaryEntrypoint) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Inputs) > 0 { + for _, e := range m.Inputs { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Output != nil { + l = m.Output.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.InitialBlock != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.InitialBlock)) + } + if m.BlockFilter != nil { + l = m.BlockFilter.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Module_KindMap_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KindMap != nil { + l = m.KindMap.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_KindStore_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KindStore != nil { + l = m.KindStore.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Module_KindBlockIndex_) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KindBlockIndex != nil { + l = m.KindBlockIndex.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Modules) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Modules: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Modules: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Modules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Modules = append(m.Modules, &Module{}) + if err := m.Modules[len(m.Modules)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Binaries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Binaries = append(m.Binaries, &Binary{}) + if err := m.Binaries[len(m.Binaries)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Binary) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Binary: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Binary: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Content = append(m.Content[:0], dAtA[iNdEx:postIndex]...) + if m.Content == nil { + m.Content = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_BlockFilter) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_BlockFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_BlockFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryString", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Query = &Module_BlockFilter_QueryString{QueryString: string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryFromParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Query.(*Module_BlockFilter_QueryFromParams); ok { + if err := oneof.QueryFromParams.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_QueryFromParams{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Query = &Module_BlockFilter_QueryFromParams{QueryFromParams: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_QueryFromParams) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_QueryFromParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_QueryFromParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_KindMap) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_KindMap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_KindMap: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutputType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_KindStore) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_KindStore: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_KindStore: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdatePolicy", wireType) + } + m.UpdatePolicy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UpdatePolicy |= Module_KindStore_UpdatePolicy(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValueType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_KindBlockIndex) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_KindBlockIndex: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_KindBlockIndex: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutputType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_FoundationalStore) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_FoundationalStore: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_FoundationalStore: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_Input_Source) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_Input_Source: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_Input_Source: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_Input_Map) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_Input_Map: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_Input_Map: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_Input_Store) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_Input_Store: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_Input_Store: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + m.Mode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mode |= Module_Input_Store_Mode(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_Input_Params) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_Input_Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_Input_Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_Input) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_Input: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_Input: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Input.(*Module_Input_Source_); ok { + if err := oneof.Source.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_Input_Source{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Input = &Module_Input_Source_{Source: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Map", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Input.(*Module_Input_Map_); ok { + if err := oneof.Map.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_Input_Map{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Input = &Module_Input_Map_{Map: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Input.(*Module_Input_Store_); ok { + if err := oneof.Store.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_Input_Store{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Input = &Module_Input_Store_{Store: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Input.(*Module_Input_Params_); ok { + if err := oneof.Params.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_Input_Params{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Input = &Module_Input_Params_{Params: v} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FoundationalStore", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Input.(*Module_Input_FoundationalStore); ok { + if err := oneof.FoundationalStore.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_FoundationalStore{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Input = &Module_Input_FoundationalStore{FoundationalStore: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module_Output) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module_Output: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module_Output: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KindMap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Kind.(*Module_KindMap_); ok { + if err := oneof.KindMap.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_KindMap{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &Module_KindMap_{KindMap: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KindStore", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Kind.(*Module_KindStore_); ok { + if err := oneof.KindStore.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_KindStore{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &Module_KindStore_{KindStore: v} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryIndex", wireType) + } + m.BinaryIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BinaryIndex |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryEntrypoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BinaryEntrypoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inputs = append(m.Inputs, &Module_Input{}) + if err := m.Inputs[len(m.Inputs)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Output == nil { + m.Output = &Module_Output{} + } + if err := m.Output.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialBlock", wireType) + } + m.InitialBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.InitialBlock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockFilter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockFilter == nil { + m.BlockFilter = &Module_BlockFilter{} + } + if err := m.BlockFilter.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KindBlockIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Kind.(*Module_KindBlockIndex_); ok { + if err := oneof.KindBlockIndex.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &Module_KindBlockIndex{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Kind = &Module_KindBlockIndex_{KindBlockIndex: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/v1/package_vtproto.pb.go b/pb/sf/substreams/v1/package_vtproto.pb.go new file mode 100644 index 000000000..7b27808a0 --- /dev/null +++ b/pb/sf/substreams/v1/package_vtproto.pb.go @@ -0,0 +1,2087 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/v1/package.proto + +package pbsubstreams + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + anypb1 "github.com/planetscale/vtprotobuf/types/known/anypb" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + anypb "google.golang.org/protobuf/types/known/anypb" + io "io" +) + +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) +) + +func (m *Package) CloneVT() *Package { + if m == nil { + return (*Package)(nil) + } + r := new(Package) + r.Version = m.Version + r.Modules = m.Modules.CloneVT() + r.Network = m.Network + r.SinkConfig = (*anypb.Any)((*anypb1.Any)(m.SinkConfig).CloneVT()) + r.SinkModule = m.SinkModule + if rhs := m.ProtoFiles; rhs != nil { + tmpContainer := make([]*descriptorpb.FileDescriptorProto, len(rhs)) + for k, v := range rhs { + if vtpb, ok := interface{}(v).(interface { + CloneVT() *descriptorpb.FileDescriptorProto + }); ok { + tmpContainer[k] = vtpb.CloneVT() + } else { + tmpContainer[k] = proto.Clone(v).(*descriptorpb.FileDescriptorProto) + } + } + r.ProtoFiles = tmpContainer + } + if rhs := m.ModuleMeta; rhs != nil { + tmpContainer := make([]*ModuleMetadata, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.ModuleMeta = tmpContainer + } + if rhs := m.PackageMeta; rhs != nil { + tmpContainer := make([]*PackageMetadata, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.PackageMeta = tmpContainer + } + if rhs := m.Image; rhs != nil { + tmpBytes := make([]byte, len(rhs)) + copy(tmpBytes, rhs) + r.Image = tmpBytes + } + if rhs := m.Networks; rhs != nil { + tmpContainer := make(map[string]*NetworkParams, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Networks = tmpContainer + } + if rhs := m.BlockFilters; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.BlockFilters = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Package) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *NetworkParams) CloneVT() *NetworkParams { + if m == nil { + return (*NetworkParams)(nil) + } + r := new(NetworkParams) + if rhs := m.InitialBlocks; rhs != nil { + tmpContainer := make(map[string]uint64, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.InitialBlocks = tmpContainer + } + if rhs := m.Params; rhs != nil { + tmpContainer := make(map[string]string, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v + } + r.Params = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *NetworkParams) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *PackageMetadata) CloneVT() *PackageMetadata { + if m == nil { + return (*PackageMetadata)(nil) + } + r := new(PackageMetadata) + r.Version = m.Version + r.Url = m.Url + r.Name = m.Name + r.Doc = m.Doc + r.Description = m.Description + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *PackageMetadata) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *ModuleMetadata) CloneVT() *ModuleMetadata { + if m == nil { + return (*ModuleMetadata)(nil) + } + r := new(ModuleMetadata) + r.PackageIndex = m.PackageIndex + r.Doc = m.Doc + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *ModuleMetadata) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Package) EqualVT(that *Package) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.ProtoFiles) != len(that.ProtoFiles) { + return false + } + for i, vx := range this.ProtoFiles { + vy := that.ProtoFiles[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &descriptorpb.FileDescriptorProto{} + } + if q == nil { + q = &descriptorpb.FileDescriptorProto{} + } + if equal, ok := interface{}(p).(interface { + EqualVT(*descriptorpb.FileDescriptorProto) bool + }); ok { + if !equal.EqualVT(q) { + return false + } + } else if !proto.Equal(p, q) { + return false + } + } + } + if this.Version != that.Version { + return false + } + if !this.Modules.EqualVT(that.Modules) { + return false + } + if len(this.ModuleMeta) != len(that.ModuleMeta) { + return false + } + for i, vx := range this.ModuleMeta { + vy := that.ModuleMeta[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &ModuleMetadata{} + } + if q == nil { + q = &ModuleMetadata{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.PackageMeta) != len(that.PackageMeta) { + return false + } + for i, vx := range this.PackageMeta { + vy := that.PackageMeta[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &PackageMetadata{} + } + if q == nil { + q = &PackageMetadata{} + } + if !p.EqualVT(q) { + return false + } + } + } + if this.Network != that.Network { + return false + } + if !(*anypb1.Any)(this.SinkConfig).EqualVT((*anypb1.Any)(that.SinkConfig)) { + return false + } + if this.SinkModule != that.SinkModule { + return false + } + if string(this.Image) != string(that.Image) { + return false + } + if len(this.Networks) != len(that.Networks) { + return false + } + for i, vx := range this.Networks { + vy, ok := that.Networks[i] + if !ok { + return false + } + if p, q := vx, vy; p != q { + if p == nil { + p = &NetworkParams{} + } + if q == nil { + q = &NetworkParams{} + } + if !p.EqualVT(q) { + return false + } + } + } + if len(this.BlockFilters) != len(that.BlockFilters) { + return false + } + for i, vx := range this.BlockFilters { + vy, ok := that.BlockFilters[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Package) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Package) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *NetworkParams) EqualVT(that *NetworkParams) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.InitialBlocks) != len(that.InitialBlocks) { + return false + } + for i, vx := range this.InitialBlocks { + vy, ok := that.InitialBlocks[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + if len(this.Params) != len(that.Params) { + return false + } + for i, vx := range this.Params { + vy, ok := that.Params[i] + if !ok { + return false + } + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *NetworkParams) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*NetworkParams) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *PackageMetadata) EqualVT(that *PackageMetadata) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Version != that.Version { + return false + } + if this.Url != that.Url { + return false + } + if this.Name != that.Name { + return false + } + if this.Doc != that.Doc { + return false + } + if this.Description != that.Description { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *PackageMetadata) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*PackageMetadata) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *ModuleMetadata) EqualVT(that *ModuleMetadata) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PackageIndex != that.PackageIndex { + return false + } + if this.Doc != that.Doc { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ModuleMetadata) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*ModuleMetadata) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Package) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Package) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Package) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.BlockFilters) > 0 { + for k := range m.BlockFilters { + v := m.BlockFilters[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x72 + } + } + if len(m.Networks) > 0 { + for k := range m.Networks { + v := m.Networks[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x6a + } + } + if len(m.Image) > 0 { + i -= len(m.Image) + copy(dAtA[i:], m.Image) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Image))) + i-- + dAtA[i] = 0x62 + } + if len(m.SinkModule) > 0 { + i -= len(m.SinkModule) + copy(dAtA[i:], m.SinkModule) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SinkModule))) + i-- + dAtA[i] = 0x5a + } + if m.SinkConfig != nil { + size, err := (*anypb1.Any)(m.SinkConfig).MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if len(m.Network) > 0 { + i -= len(m.Network) + copy(dAtA[i:], m.Network) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Network))) + i-- + dAtA[i] = 0x4a + } + if len(m.PackageMeta) > 0 { + for iNdEx := len(m.PackageMeta) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.PackageMeta[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + } + if len(m.ModuleMeta) > 0 { + for iNdEx := len(m.ModuleMeta) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.ModuleMeta[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + } + if m.Modules != nil { + size, err := m.Modules.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.Version != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x28 + } + if len(m.ProtoFiles) > 0 { + for iNdEx := len(m.ProtoFiles) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.ProtoFiles[iNdEx]).(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.ProtoFiles[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *NetworkParams) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NetworkParams) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *NetworkParams) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Params) > 0 { + for k := range m.Params { + v := m.Params[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.InitialBlocks) > 0 { + for k := range m.InitialBlocks { + v := m.InitialBlocks[k] + baseI := i + i = protohelpers.EncodeVarint(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PackageMetadata) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PackageMetadata) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PackageMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x2a + } + if len(m.Doc) > 0 { + i -= len(m.Doc) + copy(dAtA[i:], m.Doc) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Doc))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x12 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ModuleMetadata) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModuleMetadata) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModuleMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Doc) > 0 { + i -= len(m.Doc) + copy(dAtA[i:], m.Doc) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Doc))) + i-- + dAtA[i] = 0x12 + } + if m.PackageIndex != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PackageIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Package) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ProtoFiles) > 0 { + for _, e := range m.ProtoFiles { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if m.Version != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Version)) + } + if m.Modules != nil { + l = m.Modules.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.ModuleMeta) > 0 { + for _, e := range m.ModuleMeta { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + if len(m.PackageMeta) > 0 { + for _, e := range m.PackageMeta { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.Network) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.SinkConfig != nil { + l = (*anypb1.Any)(m.SinkConfig).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.SinkModule) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Image) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Networks) > 0 { + for k, v := range m.Networks { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if len(m.BlockFilters) > 0 { + for k, v := range m.BlockFilters { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *NetworkParams) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.InitialBlocks) > 0 { + for k, v := range m.InitialBlocks { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + protohelpers.SizeOfVarint(uint64(v)) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + if len(m.Params) > 0 { + for k, v := range m.Params { + _ = k + _ = v + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *PackageMetadata) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Doc) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ModuleMetadata) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PackageIndex != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PackageIndex)) + } + l = len(m.Doc) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Package) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Package: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Package: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProtoFiles", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProtoFiles = append(m.ProtoFiles, &descriptorpb.FileDescriptorProto{}) + if unmarshal, ok := interface{}(m.ProtoFiles[len(m.ProtoFiles)-1]).(interface { + UnmarshalVT([]byte) error + }); ok { + if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.ProtoFiles[len(m.ProtoFiles)-1]); err != nil { + return err + } + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Modules", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Modules == nil { + m.Modules = &Modules{} + } + if err := m.Modules.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModuleMeta = append(m.ModuleMeta, &ModuleMetadata{}) + if err := m.ModuleMeta[len(m.ModuleMeta)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PackageMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PackageMeta = append(m.PackageMeta, &PackageMetadata{}) + if err := m.PackageMeta[len(m.PackageMeta)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Network = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SinkConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SinkConfig == nil { + m.SinkConfig = &anypb.Any{} + } + if err := (*anypb1.Any)(m.SinkConfig).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SinkModule", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SinkModule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Image = append(m.Image[:0], dAtA[iNdEx:postIndex]...) + if m.Image == nil { + m.Image = []byte{} + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Networks == nil { + m.Networks = make(map[string]*NetworkParams) + } + var mapkey string + var mapvalue *NetworkParams + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return protohelpers.ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &NetworkParams{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Networks[mapkey] = mapvalue + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockFilters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockFilters == nil { + m.BlockFilters = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.BlockFilters[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NetworkParams) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: NetworkParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NetworkParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialBlocks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InitialBlocks == nil { + m.InitialBlocks = make(map[string]uint64) + } + var mapkey string + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.InitialBlocks[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return protohelpers.ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Params[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PackageMetadata) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: PackageMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PackageMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Doc", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Doc = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleMetadata) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: ModuleMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PackageIndex", wireType) + } + m.PackageIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PackageIndex |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Doc", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Doc = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/pb/sf/substreams/v1/test/test_vtproto.pb.go b/pb/sf/substreams/v1/test/test_vtproto.pb.go new file mode 100644 index 000000000..2957d4195 --- /dev/null +++ b/pb/sf/substreams/v1/test/test_vtproto.pb.go @@ -0,0 +1,779 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/v1/test/test.proto + +package pbsubstreamstest + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *Block) CloneVT() *Block { + if m == nil { + return (*Block)(nil) + } + r := new(Block) + r.Id = m.Id + r.Number = m.Number + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Block) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *MapResult) CloneVT() *MapResult { + if m == nil { + return (*MapResult)(nil) + } + r := new(MapResult) + r.BlockNumber = m.BlockNumber + r.BlockHash = m.BlockHash + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *MapResult) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Boolean) CloneVT() *Boolean { + if m == nil { + return (*Boolean)(nil) + } + r := new(Boolean) + r.Result = m.Result + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Boolean) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Array) CloneVT() *Array { + if m == nil { + return (*Array)(nil) + } + r := new(Array) + if rhs := m.Result; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Result = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Array) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Block) EqualVT(that *Block) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if this.Number != that.Number { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Block) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Block) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *MapResult) EqualVT(that *MapResult) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.BlockNumber != that.BlockNumber { + return false + } + if this.BlockHash != that.BlockHash { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *MapResult) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*MapResult) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Boolean) EqualVT(that *Boolean) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Result != that.Result { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Boolean) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Boolean) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Array) EqualVT(that *Array) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Result) != len(that.Result) { + return false + } + for i, vx := range this.Result { + vy := that.Result[i] + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Array) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Array) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Block) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Block) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Block) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Number != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MapResult) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MapResult) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *MapResult) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x12 + } + if m.BlockNumber != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BlockNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Boolean) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Boolean) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Boolean) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Result { + i-- + if m.Result { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Array) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Array) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Array) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Result) > 0 { + for iNdEx := len(m.Result) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Result[iNdEx]) + copy(dAtA[i:], m.Result[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Result[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Block) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Number != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.Number)) + } + n += len(m.unknownFields) + return n +} + +func (m *MapResult) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockNumber != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.BlockNumber)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Boolean) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Result { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *Array) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Result) > 0 { + for _, s := range m.Result { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Block) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Block: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MapResult) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: MapResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MapResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + m.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Boolean) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Boolean: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Boolean: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Result = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Array) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Array: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Array: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = append(m.Result, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/service/connect/service.go b/service/connect/service.go new file mode 100644 index 000000000..7fc7450c4 --- /dev/null +++ b/service/connect/service.go @@ -0,0 +1,91 @@ +package connect + +import ( + "context" + "fmt" + "net/http" + + "connectrpc.com/connect" + pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" + pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" + pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" + "github.com/streamingfast/substreams/reqctx" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +type Tier1Service interface { + BlocksAny( + ctx context.Context, + request *pbsubstreamsrpc.Request, + header http.Header, + protocol string, + pkg *pbsubstreams.Package, + stream grpc.ServerStream, + ) error +} + +type Service struct { + inner Tier1Service +} + +func NewService(inner Tier1Service) *Service { + return &Service{inner: inner} +} + +func (s *Service) Blocks( + ctx context.Context, + req *connect.Request[pbsubstreamsrpc.Request], + stream *connect.ServerStream[pbsubstreamsrpc.Response], +) error { + return s.inner.BlocksAny(ctx, req.Msg, req.Header(), pbsubstreamsrpcv2connect.StreamBlocksProcedure, nil, &serverStreamWrapper{stream, ctx}) +} + +func (s *Service) BlocksV3( + ctx context.Context, + req *connect.Request[pbsubstreamsrpcv3.Request], + stream *connect.ServerStream[pbsubstreamsrpc.Response], +) error { + if req.Msg.Package == nil { + return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("package is required")) + } + + ctx = reqctx.WithSpkg(ctx, req.Msg.Package) + + v2req, err := req.Msg.ToV2() + if err != nil { + return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("failed to convert request to v2: %w", err)) + } + + return s.inner.BlocksAny(ctx, v2req, req.Header(), pbsubstreamsrpcv3connect.StreamBlocksProcedure, req.Msg.Package, &serverStreamWrapper{stream, ctx}) +} + +type serverStreamWrapper struct { + *connect.ServerStream[pbsubstreamsrpc.Response] + ctx context.Context +} + +func (w *serverStreamWrapper) SetHeader(metadata.MD) error { + return nil +} + +func (w *serverStreamWrapper) SendHeader(metadata.MD) error { + return nil +} + +func (w *serverStreamWrapper) SetTrailer(metadata.MD) { +} + +func (w *serverStreamWrapper) Context() context.Context { + return w.ctx +} + +func (w *serverStreamWrapper) SendMsg(m interface{}) error { + return w.ServerStream.Send(m.(*pbsubstreamsrpc.Response)) +} + +func (w *serverStreamWrapper) RecvMsg(m interface{}) error { + return fmt.Errorf("not implemented") +} From 6eacb86be202c6d5f634a4fc9817f89f179df2e6 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 12:55:06 -0500 Subject: [PATCH 11/47] Refactor `ListenTier1` to unify gRPC and Connect server handling and simplify address management. --- app/tier1.go | 20 +-------- go.mod | 6 +-- go.sum | 4 +- service/server.go | 108 +++++++++------------------------------------- 4 files changed, 24 insertions(+), 114 deletions(-) diff --git a/app/tier1.go b/app/tier1.go index 5a38fcf5c..d1d726818 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -310,12 +310,6 @@ func (a *Tier1App) Run() error { secureGrpcProxyAddr := ":9000" plaintextGrpcProxyAddr := ":8080" - secureGrpcAddr := ":9100" - plaintextGrpcAddr := ":8180" - - secureConnectProxyAddr := ":9200" - plaintextConnectProxyAddr := ":8180" - addresses := strings.Split(a.config.GRPCListenAddr, ",") addressCount := len(addresses) if addressCount == 0 { @@ -328,20 +322,8 @@ func (a *Tier1App) Run() error { if addressCount > 1 { plaintextGrpcProxyAddr = addresses[1] } - if addressCount > 2 { - secureGrpcAddr = addresses[2] - } - if addressCount > 3 { - plaintextGrpcAddr = addresses[3] - } - if addressCount > 4 { - secureConnectProxyAddr = addresses[4] - } - if addressCount > 5 { - plaintextConnectProxyAddr = addresses[5] - } - err := service.ListenTier1(secureGrpcProxyAddr, plaintextGrpcProxyAddr, secureGrpcAddr, plaintextGrpcAddr, secureConnectProxyAddr, plaintextConnectProxyAddr, tier1Service, tier1ServiceConnect, infoServer, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) + err := service.ListenTier1(secureGrpcProxyAddr, plaintextGrpcProxyAddr, tier1Service, tier1ServiceConnect, infoServer, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) a.Shutdown(err) }() diff --git a/go.mod b/go.mod index c7d6787a4..95b9e3c81 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,6 @@ go 1.25.0 toolchain go1.25.4 -//replace ( -// github.com/streamingfast/dgrpc => ../dgrpc -//) - require ( github.com/golang/protobuf v1.5.4 github.com/jhump/protoreflect v1.14.0 @@ -18,7 +14,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260210154506-666c5437f4e6 + github.com/streamingfast/dgrpc v0.0.0-20260210174949-b033ef4d8421 github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 diff --git a/go.sum b/go.sum index dc4966039..303483c77 100644 --- a/go.sum +++ b/go.sum @@ -559,8 +559,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20260210154506-666c5437f4e6 h1:VDqT97gPCyCxsydarUmK4aU/R/IreRFjY4a5TT/0xgA= -github.com/streamingfast/dgrpc v0.0.0-20260210154506-666c5437f4e6/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= +github.com/streamingfast/dgrpc v0.0.0-20260210174949-b033ef4d8421 h1:4gOB7sCO3r5qo/yR0KfV8x+aTvwBeEDsn1Cn7L5biII= +github.com/streamingfast/dgrpc v0.0.0-20260210174949-b033ef4d8421/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= diff --git a/service/server.go b/service/server.go index 5c61891a7..5ee80e6d8 100644 --- a/service/server.go +++ b/service/server.go @@ -20,6 +20,7 @@ import ( dgrpcserver "github.com/streamingfast/dgrpc/server" connectweb "github.com/streamingfast/dgrpc/server/connectrpc" "github.com/streamingfast/dgrpc/server/factory" + "github.com/streamingfast/dgrpc/server/standard" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" @@ -58,10 +59,6 @@ func (a *v3Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3 func ListenTier1( secureProxyListenAddress string, plaintextProxyListenAddress string, - secureGrpcListenAddress string, - plaintextGrpcListenAddress string, - secureConnectListenAddress string, - plaintextConnectListenAddress string, svc *Tier1Service, connectSvc *tier1Connect.Service, infoService pbsubstreamsrpc.EndpointInfoServer, @@ -71,89 +68,32 @@ func ListenTier1( enforceCompression bool, ) (err error) { - var secureGrpcServer dgrpcserver.Server - var plaintextGrpcServer dgrpcserver.Server - var secureConnectServer dgrpcserver.Server - var plaintextConnectServer dgrpcserver.Server - if plaintextGrpcListenAddress != "" { - plaintextGrpcServer = grpcSever(plaintextGrpcListenAddress, svc, infoService, auth, healthcheck, enforceCompression, logger) - go func() { - logger.Info("starting grpc server", zap.String("address", plaintextGrpcListenAddress)) - plaintextGrpcServer.Launch(strings.ReplaceAll(plaintextGrpcListenAddress, "*", "")) - }() - } - - if secureGrpcListenAddress != "" { - secureGrpcServer = grpcSever(secureGrpcListenAddress, svc, infoService, auth, healthcheck, enforceCompression, logger) - go func() { - logger.Info("starting grpc server", zap.String("address", secureGrpcListenAddress)) - secureGrpcServer.Launch(strings.ReplaceAll(secureGrpcListenAddress, "*", "")) - }() - } - - if plaintextConnectListenAddress != "" { - plaintextConnectServer = connectServer(plaintextConnectListenAddress, connectSvc, infoService, auth, healthcheck, enforceCompression, logger) - go func() { - logger.Info("starting connect server", zap.String("address", plaintextConnectListenAddress)) - plaintextConnectServer.Launch(strings.ReplaceAll(plaintextConnectListenAddress, "*", "")) - }() - } - - if secureConnectListenAddress != "" { - secureConnectServer = connectServer(secureConnectListenAddress, connectSvc, infoService, auth, healthcheck, enforceCompression, logger) - go func() { - logger.Info("starting connect server", zap.String("address", secureConnectListenAddress)) - secureConnectServer.Launch(strings.ReplaceAll(secureConnectListenAddress, "*", "")) - }() - } + grpcServer := grpcSever(secureProxyListenAddress, svc, infoService, auth, healthcheck, enforceCompression, logger) + connectServer := connectServer(secureProxyListenAddress, connectSvc, infoService, auth, healthcheck, enforceCompression, logger) - // The main multiplexer / router mux := http.NewServeMux() - - // Catch-all handler that decides based on Content-Type mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { contentType := r.Header.Get("Content-Type") - isSecure := r.TLS != nil - - // gRPC protocol starts with application/grpc - // gRPC-Web often uses application/grpc-web or application/grpc-web+proto - if strings.HasPrefix(contentType, "application/grpc") || - strings.HasPrefix(contentType, "application/grpc-web") { - - if isSecure { - logger.Debug("forwarding gRPC request over HTTPS") - secureGrpcServer.ServeHTTP(w, r) - return - } - logger.Debug("forwarding gRPC request over HTTP") - plaintextGrpcServer.ServeHTTP(w, r) - return - } - // Connect protocol: application/connect+proto or application/connect+json - // Also catch JSON for REST-like testing - if strings.HasPrefix(contentType, "application/connect") || - contentType == "application/json" || - strings.Contains(contentType, "json") { // loose match for safety + if strings.HasPrefix(contentType, "application/grpc") || strings.HasPrefix(contentType, "application/grpc-web") { + logger.Debug("forwarding gRPC request") + grpcServer.ServeHTTP(w, r) - if isSecure { - logger.Debug("forwarding gRPC-Web request over HTTPS") - secureConnectServer.ServeHTTP(w, r) - return - } - - logger.Debug("forwarding gRPC-Web request over HTTP") - plaintextConnectServer.ServeHTTP(w, r) + return + } + if strings.HasPrefix(contentType, "application/connect") || contentType == "application/json" || strings.Contains(contentType, "json") { // loose match for safety + logger.Debug("forwarding gRPC-Web request") + connectServer.ServeHTTP(w, r) return + } - // Fallback: could return 415 or route to one by default http.Error(w, "Unsupported Content-Type for RPC", http.StatusUnsupportedMediaType) }) - // Support HTTP/1.1 → h2c upgrade + direct h2 - handler := h2c.NewHandler(mux, &http2.Server{}) + compressionHandler := standard.CompressionHandler(enforceCompression, mux) + handler := h2c.NewHandler(compressionHandler, &http2.Server{}) logger.Info("starting secure proxy server", zap.String("address", secureProxyListenAddress)) go func() { @@ -170,21 +110,13 @@ func ListenTier1( logger.Info("started") - if secureGrpcServer != nil { - <-secureGrpcServer.Terminating() - logger.Info("secure gRPC server terminated", zap.Error(secureGrpcServer.Error())) - } - if plaintextGrpcServer != nil { - <-plaintextGrpcServer.Terminating() - logger.Info("secure gRPC server terminated", zap.Error(plaintextGrpcServer.Error())) - } - if secureConnectServer != nil { - <-secureConnectServer.Terminating() - logger.Info("secure gRPC server terminated", zap.Error(secureConnectServer.Error())) + if grpcServer != nil { + <-grpcServer.Terminating() + logger.Info("gRPC server terminated", zap.Error(grpcServer.Error())) } - if plaintextConnectServer != nil { - <-plaintextConnectServer.Terminating() - logger.Info("secure gRPC server terminated", zap.Error(plaintextConnectServer.Error())) + if connectServer != nil { + <-connectServer.Terminating() + logger.Info("gRPC server terminated", zap.Error(connectServer.Error())) } return From 9e93fbfc1b6a82d2612e35dee82f0ba2aea6063a Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 13:18:14 -0500 Subject: [PATCH 12/47] Add logging for request content type in HTTP handler --- service/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/service/server.go b/service/server.go index 5ee80e6d8..624c1fceb 100644 --- a/service/server.go +++ b/service/server.go @@ -74,6 +74,7 @@ func ListenTier1( mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { contentType := r.Header.Get("Content-Type") + logger.Info("handling request", zap.String("content-type", contentType)) if strings.HasPrefix(contentType, "application/grpc") || strings.HasPrefix(contentType, "application/grpc-web") { logger.Debug("forwarding gRPC request") From b0eb9940e6eeca9addaa9a33dc25c36297dfca40 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 13:49:57 -0500 Subject: [PATCH 13/47] Remove unused imports and commented-out VT Proto registration code --- service/server.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/service/server.go b/service/server.go index 624c1fceb..6c19f300e 100644 --- a/service/server.go +++ b/service/server.go @@ -2,7 +2,6 @@ package service import ( "context" - "fmt" "net/http" "net/url" "strings" @@ -13,7 +12,6 @@ import ( _ "github.com/mostynb/go-grpc-compression/experimental/s2" _ "github.com/mostynb/go-grpc-compression/lz4" _ "github.com/mostynb/go-grpc-compression/zstd" - vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dauth" dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" @@ -33,14 +31,13 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "google.golang.org/grpc" - "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/experimental" ) -func init() { - fmt.Println("------------------ VT Proto registered ------------------------") - encoding.RegisterCodec(vt.Codec{}) -} +//func init() { +// fmt.Println("------------------ VT Proto registered ------------------------") +// encoding.RegisterCodec(vt.Codec{}) +//} type streamHandlerV3 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error @@ -82,7 +79,6 @@ func ListenTier1( return } - if strings.HasPrefix(contentType, "application/connect") || contentType == "application/json" || strings.Contains(contentType, "json") { // loose match for safety logger.Debug("forwarding gRPC-Web request") connectServer.ServeHTTP(w, r) From 6196f150ebd00e03dd771098fc907640935cc8c7 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 13:51:32 -0500 Subject: [PATCH 14/47] Add vtprotobuf gRPC codec import to server initialization --- service/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/service/server.go b/service/server.go index 6c19f300e..df5fe0748 100644 --- a/service/server.go +++ b/service/server.go @@ -12,6 +12,7 @@ import ( _ "github.com/mostynb/go-grpc-compression/experimental/s2" _ "github.com/mostynb/go-grpc-compression/lz4" _ "github.com/mostynb/go-grpc-compression/zstd" + _ "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dauth" dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" From ed958e93cbf11aa78794d5508ae9c2b67e101d1b Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 14:17:19 -0500 Subject: [PATCH 15/47] Remove vtprotobuf gRPC codec import and associated registration code --- client/client.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/client.go b/client/client.go index 9c3bbdddc..23e53cfff 100644 --- a/client/client.go +++ b/client/client.go @@ -12,7 +12,6 @@ import ( "github.com/dustin/go-humanize" "github.com/mostynb/go-grpc-compression/experimental/s2" - vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" "github.com/streamingfast/logging/zapx" @@ -25,16 +24,15 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/oauth" xdscreds "google.golang.org/grpc/credentials/xds" - "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/encoding/gzip" stats "google.golang.org/grpc/stats" _ "google.golang.org/grpc/xds" ) -func init() { - fmt.Println("------------------ VT Proto registered ------------------------") - encoding.RegisterCodec(vt.Codec{}) -} +//func init() { +// fmt.Println("------------------ VT Proto registered ------------------------") +// encoding.RegisterCodec(vt.Codec{}) +//} type AuthType int From 95c099e1d1fc54a352b64916daa047e811712613 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Tue, 10 Feb 2026 15:14:39 -0500 Subject: [PATCH 16/47] Fix dead lock in message buffer --- orchestrator/execout/message_buffer.go | 2 +- orchestrator/scheduler/scheduler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index b016a2d66..624f35c28 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -41,7 +41,7 @@ func (b *MessageBuffer) ShouldFlush() bool { b.mut.Lock() defer b.mut.Unlock() - if b.Len() > b.maxBufferedMessage { + if len(b.buf.Items) > b.maxBufferedMessage { return true } diff --git a/orchestrator/scheduler/scheduler.go b/orchestrator/scheduler/scheduler.go index 27eac0b9e..c9a1a6f2d 100644 --- a/orchestrator/scheduler/scheduler.go +++ b/orchestrator/scheduler/scheduler.go @@ -385,7 +385,7 @@ func (s *Scheduler) cmdShutdownWhenComplete() loop.Cmd { ) } - s.logger.Info("waiting for output stream to complete, stores ready", fields...) + s.logger.Info("`waiting for output stream to complete, stores ready", fields...) } if s.outputStreamCompleted && !s.storesSyncCompleted { s.logger.Info("waiting for stores to complete, output stream completed") From 0c19a1b304c306b85d44fe3b6ce1a3b7da40d458 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 11 Feb 2026 08:54:57 -0500 Subject: [PATCH 17/47] Add Connect handler for `InfoServer` and integrate it into Tier1 service initialization --- app/tier1.go | 25 ++++++++++++++++++++++--- service/server.go | 36 ++++++++++++++++-------------------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/app/tier1.go b/app/tier1.go index d1d726818..be19aaeb3 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -9,11 +9,12 @@ import ( "strings" "time" + connectrpc "connectrpc.com/connect" "github.com/streamingfast/bstream" "github.com/streamingfast/bstream/blockstream" "github.com/streamingfast/bstream/hub" pbbstream "github.com/streamingfast/bstream/pb/sf/bstream/v1" - dauth "github.com/streamingfast/dauth" + "github.com/streamingfast/dauth" "github.com/streamingfast/dmetrics" "github.com/streamingfast/dsession" "github.com/streamingfast/dstore" @@ -22,11 +23,11 @@ import ( "github.com/streamingfast/substreams/client" "github.com/streamingfast/substreams/metrics" pbsubstreamsrpcv2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" "github.com/streamingfast/substreams/reqctx" "github.com/streamingfast/substreams/service" "github.com/streamingfast/substreams/service/connect" "github.com/streamingfast/substreams/wasm" - _ "github.com/streamingfast/substreams/wasm/wasmtime" "github.com/streamingfast/substreams/wasm/wazero" "go.uber.org/atomic" @@ -294,6 +295,12 @@ func (a *Tier1App) Run() error { } } + var infoServerConnect pbsubstreamsrpcv2connect.EndpointInfoHandler + if a.modules.InfoServer != nil { + infoServerConnect = &InfoServerConnectWrapper{a.modules.InfoServer} + a.logger.Info("info server ready") + } + if withLive { a.logger.Info("waiting until hub is real-time synced") select { @@ -323,7 +330,7 @@ func (a *Tier1App) Run() error { plaintextGrpcProxyAddr = addresses[1] } - err := service.ListenTier1(secureGrpcProxyAddr, plaintextGrpcProxyAddr, tier1Service, tier1ServiceConnect, infoServer, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) + err := service.ListenTier1(secureGrpcProxyAddr, plaintextGrpcProxyAddr, tier1Service, tier1ServiceConnect, infoServer, infoServerConnect, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) a.Shutdown(err) }() @@ -381,3 +388,15 @@ func (i *InfoServerWrapper) Info(ctx context.Context, req *pbfirehose.InfoReques } return resp, nil } + +type InfoServerConnectWrapper struct { + rpcInfoServer pbsubstreamsrpcv2.EndpointInfoServer +} + +func (i *InfoServerConnectWrapper) Info(ctx context.Context, req *connectrpc.Request[pbfirehose.InfoRequest]) (*connectrpc.Response[pbfirehose.InfoResponse], error) { + resp, err := i.rpcInfoServer.Info(ctx, req.Msg) + if err != nil { + return nil, err + } + return connectrpc.NewResponse(resp), nil +} diff --git a/service/server.go b/service/server.go index df5fe0748..77ebbb826 100644 --- a/service/server.go +++ b/service/server.go @@ -60,6 +60,7 @@ func ListenTier1( svc *Tier1Service, connectSvc *tier1Connect.Service, infoService pbsubstreamsrpc.EndpointInfoServer, + infoServiceConnect pbsubstreamsrpcv2connect.EndpointInfoHandler, auth dauth.Authenticator, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, @@ -67,7 +68,7 @@ func ListenTier1( ) (err error) { grpcServer := grpcSever(secureProxyListenAddress, svc, infoService, auth, healthcheck, enforceCompression, logger) - connectServer := connectServer(secureProxyListenAddress, connectSvc, infoService, auth, healthcheck, enforceCompression, logger) + connectServer := connectServer(secureProxyListenAddress, connectSvc, infoServiceConnect, auth, healthcheck, enforceCompression, logger) mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -153,7 +154,7 @@ func grpcSever( func connectServer( address string, service *tier1Connect.Service, - infoService pbsubstreamsrpc.EndpointInfoServer, + infoService pbsubstreamsrpcv2connect.EndpointInfoHandler, auth dauth.Authenticator, healthcheck dgrpcserver.HealthCheck, enforceCompression bool, @@ -190,24 +191,19 @@ func connectServer( handlerGetters := []connectweb.HandlerGetter{streamHandlerGetter, streamHandlerGetterV3} - //GRRRRRRRRRRRRRRRRRRRR - //GRRRRRRRRRRRRRRRRRRRR - // FIX ME! - //GRRRRRRRRRRRRRRRRRRRR - //GRRRRRRRRRRRRRRRRRRRR - //if infoService != nil { - // infoHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { - // - // var o []connect.HandlerOption - // for _, opt := range opts { - // o = append(o, opt) - // } - // o = append(o, compress.WithAll(compress.LevelBalanced)) - // out, outh := pbsubstreamsrpcv2connect.NewEndpointInfoHandler(infoService, o...) - // return out, outh - // } - // handlerGetters = append(handlerGetters, infoHandlerGetter) - //} + if infoService != nil { + infoHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { + + var o []connect.HandlerOption + for _, opt := range opts { + o = append(o, opt) + } + o = append(o, compress.WithAll(compress.LevelBalanced)) + out, outh := pbsubstreamsrpcv2connect.NewEndpointInfoHandler(infoService, o...) + return out, outh + } + handlerGetters = append(handlerGetters, infoHandlerGetter) + } options = append(options, dgrpcserver.WithConnectPermissiveCORS()) server := connectweb.New(handlerGetters, options...) From 4a95c2af34fee5f2dd0ea68b7f1abbc319fedfa1 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 11 Feb 2026 10:55:44 -0500 Subject: [PATCH 18/47] Update `dgrpc` dependency, add buffer size configuration, and refactor server initialization with new handlers and logging --- app/tier1.go | 4 +- go.mod | 4 +- go.sum | 2 - orchestrator/execout/execout_walker.go | 8 +++- orchestrator/parallelprocessor.go | 2 + pipeline/pipeline.go | 4 ++ service/server.go | 11 +++++- service/testing.go | 2 +- service/tier1.go | 52 ++++++++++++++------------ service/tier2.go | 1 + 10 files changed, 59 insertions(+), 31 deletions(-) diff --git a/app/tier1.go b/app/tier1.go index be19aaeb3..6f3277aa2 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -88,7 +88,8 @@ type Tier1Config struct { SubrequestsInsecure bool SubrequestsPlaintext bool - SharedCacheSize uint64 + SharedCacheSize uint64 + ExecOutMessageBufferSize uint64 WASMExtensions wasm.WASMExtensioner Tracing bool @@ -268,6 +269,7 @@ func (a *Tier1App) Run() error { a.config.ActiveRequestsSoftLimit, a.config.ActiveRequestsHardLimit, a.config.SharedCacheSize, + a.config.ExecOutMessageBufferSize, a.modules.SessionPool, foundationalStoreEndpoints, opts..., diff --git a/go.mod b/go.mod index 95b9e3c81..f8ba1a5eb 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,8 @@ go 1.25.0 toolchain go1.25.4 +replace github.com/streamingfast/dgrpc => ../dgrpc + require ( github.com/golang/protobuf v1.5.4 github.com/jhump/protoreflect v1.14.0 @@ -14,7 +16,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260210174949-b033ef4d8421 + github.com/streamingfast/dgrpc v0.0.0-20260211152336-d4e7023003dd github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 diff --git a/go.sum b/go.sum index 303483c77..807521815 100644 --- a/go.sum +++ b/go.sum @@ -559,8 +559,6 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20260210174949-b033ef4d8421 h1:4gOB7sCO3r5qo/yR0KfV8x+aTvwBeEDsn1Cn7L5biII= -github.com/streamingfast/dgrpc v0.0.0-20260210174949-b033ef4d8421/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= diff --git a/orchestrator/execout/execout_walker.go b/orchestrator/execout/execout_walker.go index b5e328ce8..4c1b7c1b6 100644 --- a/orchestrator/execout/execout_walker.go +++ b/orchestrator/execout/execout_walker.go @@ -42,6 +42,7 @@ func NewWalker( walkRange *block.Range, stream *response.Stream, noopMode bool, + bufferSize int, ) *Walker { logger := reqctx.Logger(ctx).Named("execout_walker") return &Walker{ @@ -52,7 +53,12 @@ func NewWalker( streamOut: stream, noopMode: noopMode, logger: logger, - buffer: NewMessageBuffer(100), + buffer: NewMessageBuffer(func() int { + if bufferSize <= 0 { + return 100 + } + return bufferSize + }()), } } diff --git a/orchestrator/parallelprocessor.go b/orchestrator/parallelprocessor.go index 617bf7a42..9f1f27c68 100644 --- a/orchestrator/parallelprocessor.go +++ b/orchestrator/parallelprocessor.go @@ -33,6 +33,7 @@ func BuildParallelProcessor( respFunc func(resp substreams.ResponseFromAnyTier) error, storeConfigs store.ConfigMap, noopMode bool, + bufferSize int, ) (*ParallelProcessor, error) { // FIXME: Are all the progress messages properly sent? When we skip some stores and mark them complete, @@ -68,6 +69,7 @@ func BuildParallelProcessor( reqPlan.ReadExecOut, stream, noopMode, + bufferSize, ) } } diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index e0faf3480..51b9be966 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -132,6 +132,7 @@ type Pipeline struct { blockStepMap map[bstream.StepType]uint64 workerPoolFactory work.WorkerPoolFactory checkPendingShutdown func() bool + bufferSize int } func New( @@ -150,6 +151,7 @@ func New( executionTimeout time.Duration, checkPendingShutdown func() bool, foundationalEndpoints map[string]string, + bufferSize int, opts ...Option, ) *Pipeline { pipe := &Pipeline{ @@ -175,6 +177,7 @@ func New( workerPoolFactory: workerPoolFactory, checkPendingShutdown: checkPendingShutdown, moduleNameToStage: make(map[string]int), + bufferSize: bufferSize, } for _, opt := range opts { opt(pipe) @@ -502,6 +505,7 @@ func (p *Pipeline) runParallelProcess(ctx context.Context, reqPlan *plan.Request p.respFunc, p.stores.configs, noopMode, + p.bufferSize, ) if err != nil { return nil, fmt.Errorf("building parallel processor: %w", err) diff --git a/service/server.go b/service/server.go index 77ebbb826..aa0642e59 100644 --- a/service/server.go +++ b/service/server.go @@ -2,6 +2,7 @@ package service import ( "context" + "fmt" "net/http" "net/url" "strings" @@ -74,6 +75,7 @@ func ListenTier1( mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { contentType := r.Header.Get("Content-Type") logger.Info("handling request", zap.String("content-type", contentType)) + fmt.Println("Grrrrrr: Handling request with content-type:", contentType) if strings.HasPrefix(contentType, "application/grpc") || strings.HasPrefix(contentType, "application/grpc-web") { logger.Debug("forwarding gRPC request") @@ -92,18 +94,25 @@ func ListenTier1( }) compressionHandler := standard.CompressionHandler(enforceCompression, mux) - handler := h2c.NewHandler(compressionHandler, &http2.Server{}) + + rootMux := http.NewServeMux() + rootMux.Handle("/healthz", grpcServer.HealthHandler()) + rootMux.Handle("/", compressionHandler) + + handler := h2c.NewHandler(rootMux, &http2.Server{}) logger.Info("starting secure proxy server", zap.String("address", secureProxyListenAddress)) go func() { if err := http.ListenAndServe(strings.ReplaceAll(secureProxyListenAddress, "*", ""), handler); err != nil { logger.Error("failed to start secure proxy server", zap.Error(err)) + grpcServer.Shutdown(0) } }() logger.Info("starting plaintext proxy server", zap.String("address", plaintextProxyListenAddress)) go func() { if err := http.ListenAndServe(strings.ReplaceAll(plaintextProxyListenAddress, "*", ""), handler); err != nil { logger.Error("failed to start secure proxy server", zap.Error(err)) + connectServer.Shutdown(0) } }() diff --git a/service/testing.go b/service/testing.go index 25fe483b1..f49585d86 100644 --- a/service/testing.go +++ b/service/testing.go @@ -44,7 +44,7 @@ func (s *Tier1Service) TestBlocks(ctx context.Context, isSubRequest bool, reques return stream.NewErrInvalidArg("%s", err.Error()) } - return s.blocks(ctx, nil, request, nil, execGraph, respFunc, metrics.NewReqStats(&metrics.Config{}, nil, nil, zap.NewNop()), nil) + return s.blocks(ctx, nil, request, nil, execGraph, respFunc, metrics.NewReqStats(&metrics.Config{}, nil, nil, zap.NewNop()), nil, 0) } func TestNewServiceTier2(moduleExecutionTracing bool, streamFactoryFunc StreamFactoryFunc) *Tier2Service { diff --git a/service/tier1.go b/service/tier1.go index 77a58deed..7ee08cc94 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -85,13 +85,14 @@ type Tier1Service struct { resolveCursor pipeline.CursorResolver getHeadBlock func() (uint64, error) - enforceCompression bool - activeRequestsSoftLimit int - activeRequestsHardLimit int - tier2RequestParameters reqctx.Tier2RequestParameters - foundationalEndpoints map[string]string - sessionPool dsession.SessionPool - activeRequestsManager *active_requests.ActiveRequestsManager // we keep a list of current requests for the debugAPI and to manage memory + enforceCompression bool + activeRequestsSoftLimit int + activeRequestsHardLimit int + tier2RequestParameters reqctx.Tier2RequestParameters + foundationalEndpoints map[string]string + sessionPool dsession.SessionPool + activeRequestsManager *active_requests.ActiveRequestsManager // we keep a list of current requests for the debugAPI and to manage memory + execOutMessageBufferSize int } func getBlockTypeFromStreamFactory(sf *StreamFactory) (string, error) { @@ -158,6 +159,7 @@ func NewTier1( activeRequestsSoftLimit int, activeRequestsHardLimit int, sharedCacheSize uint64, + execOutMessageBufferSize uint64, sessionPool dsession.SessionPool, foundationalEndpoints map[string]string, opts ...Option, @@ -200,21 +202,22 @@ func NewTier1( logger.Info("launching tier1 service", zap.Reflect("client_config", substreamsClientConfig), zap.String("block_type", blockType), zap.Bool("with_live", hub != nil)) s := &Tier1Service{ - Shutter: shutter.New(), - runtimeConfig: runtimeConfig, - blockType: blockType, - tracer: tracing.GetTracer(), - resolveCursor: pipeline.NewCursorResolver(hub, mergedBlocksStore, forkedBlocksStore), - logger: logger, - appSetIsReadyState: appSetIsReadyState, - tier2RequestParameters: tier2RequestParameters, - blockExecutionTimeout: 3 * time.Minute, - enforceCompression: enforceCompression, - activeRequestsSoftLimit: activeRequestsSoftLimit, - activeRequestsHardLimit: activeRequestsHardLimit, - foundationalEndpoints: foundationalEndpoints, - sessionPool: sessionPool, - activeRequestsManager: active_requests.NewActiveRequestsManager(logger), + Shutter: shutter.New(), + runtimeConfig: runtimeConfig, + blockType: blockType, + tracer: tracing.GetTracer(), + resolveCursor: pipeline.NewCursorResolver(hub, mergedBlocksStore, forkedBlocksStore), + logger: logger, + appSetIsReadyState: appSetIsReadyState, + tier2RequestParameters: tier2RequestParameters, + blockExecutionTimeout: 3 * time.Minute, + enforceCompression: enforceCompression, + activeRequestsSoftLimit: activeRequestsSoftLimit, + activeRequestsHardLimit: activeRequestsHardLimit, + foundationalEndpoints: foundationalEndpoints, + sessionPool: sessionPool, + activeRequestsManager: active_requests.NewActiveRequestsManager(logger), + execOutMessageBufferSize: int(execOutMessageBufferSize), } s.OnTerminating(func(_ error) { s.activeRequestsWG.Wait() @@ -585,7 +588,7 @@ func (s *Tier1Service) BlocksAny( runningContext = reqctx.WithCancelFunc(runningContext, cancelRunning) // we pass this down so that the 'workerPool/requestPool' can cancel the running context respFunc := tier1ResponseHandler(respContext, &mut, logger, stream, request.NoopMode, reqStats, request.DevOutputModules) - err = s.blocks(runningContext, cancelRunning, request, header, execGraph, respFunc, reqStats, fields) + err = s.blocks(runningContext, cancelRunning, request, header, execGraph, respFunc, reqStats, fields, s.execOutMessageBufferSize) if connectError := toConnectError(runningContext, err); connectError != nil { switch connect.CodeOf(connectError) { @@ -675,7 +678,7 @@ func (s *Tier1Service) writeLastUsed(ctx context.Context, execGraph *exec.Graph, var IsValidCacheTag = regexp.MustCompile(`^[a-zA-Z0-9_-]+$`).MatchString -func (s *Tier1Service) blocks(ctx context.Context, cancelRunning context.CancelCauseFunc, request *pbsubstreamsrpc.Request, header http.Header, execGraph *exec.Graph, respFunc substreams.ResponseFunc, reqStats *metrics.Stats, logFields []zap.Field) (err error) { +func (s *Tier1Service) blocks(ctx context.Context, cancelRunning context.CancelCauseFunc, request *pbsubstreamsrpc.Request, header http.Header, execGraph *exec.Graph, respFunc substreams.ResponseFunc, reqStats *metrics.Stats, logFields []zap.Field, execOutMessageBufferSize int) (err error) { chainFirstStreamableBlock := bstream.GetProtocolFirstStreamableBlock if request.StartBlockNum > 0 && request.StartBlockNum < int64(chainFirstStreamableBlock) { return bsstream.NewErrInvalidArg("invalid start block %d, must be >= %d (the first streamable block of the chain)", request.StartBlockNum, chainFirstStreamableBlock) @@ -844,6 +847,7 @@ func (s *Tier1Service) blocks(ctx context.Context, cancelRunning context.CancelC return s.IsTerminating() // pipeline starts draining when the service is actually terminating, (after the global shutdown-signal-delay) }, s.foundationalEndpoints, + execOutMessageBufferSize, opts..., ) diff --git a/service/tier2.go b/service/tier2.go index 1269a2ea2..5702b37b1 100644 --- a/service/tier2.go +++ b/service/tier2.go @@ -521,6 +521,7 @@ func (s *Tier2Service) processRange(ctx context.Context, request *pbssinternal.P s.blockExecutionTimeout, s.checkPendingShutdown, request.FoundationalStoreEndpoints, + 0, opts..., ) From 78155e67a29d7d0e381b50e9a40dcb340aefe28d Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 11 Feb 2026 12:13:06 -0500 Subject: [PATCH 19/47] Refactor server initialization to improve gRPC server handling and update `dgrpc` dependency. --- go.mod | 4 +--- go.sum | 2 ++ go.work.sum | 2 ++ service/server.go | 61 ++++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index f8ba1a5eb..834c746fd 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,6 @@ go 1.25.0 toolchain go1.25.4 -replace github.com/streamingfast/dgrpc => ../dgrpc - require ( github.com/golang/protobuf v1.5.4 github.com/jhump/protoreflect v1.14.0 @@ -16,7 +14,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260211152336-d4e7023003dd + github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 diff --git a/go.sum b/go.sum index 807521815..fd0fd0879 100644 --- a/go.sum +++ b/go.sum @@ -559,6 +559,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= +github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd h1:LRu2q7HnzkU/G+K3/m1VrXDszUS8G47v9qAuDI56BXQ= +github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= diff --git a/go.work.sum b/go.work.sum index 2e5bbf158..33ce3aa69 100644 --- a/go.work.sum +++ b/go.work.sum @@ -988,6 +988,8 @@ github.com/streamingfast/bstream v0.0.2-0.20251218133631-a5f5c59a7c05/go.mod h1: github.com/streamingfast/derr v0.0.0-20210811180100-9138d738bcec/go.mod h1:ulVfui/yGXmPBbt9aAqCWdAjM7YxnZkYHzvQktLfw3M= github.com/streamingfast/dgrpc v0.0.0-20250227145723-9bc2e4941b4e/go.mod h1:qdcskj9WmO+nDjgxyafc5oMCftTZolOk693p2ZFUdO8= github.com/streamingfast/dgrpc v0.0.0-20251218133127-15b36e02a74f/go.mod h1:B+RAf6/idk6Kz41wEAEeQH1PW3Bk6WQkmvuRhdTEgKg= +github.com/streamingfast/dgrpc v0.0.0-20260211152336-d4e7023003dd h1:w/K/23PASRF0jXPDcbjuboA/Q+AGVlikmdqLfHW4fSo= +github.com/streamingfast/dgrpc v0.0.0-20260211152336-d4e7023003dd/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dhammer v0.0.0-20230125192823-c34bbd561bd4/go.mod h1:ehPytv7E4rI65iLcrwTes4rNGGqPPiugnH+20nDQyp4= github.com/streamingfast/dmetrics v0.0.0-20210811180524-8494aeb34447/go.mod h1:VLdQY/FwczmC/flqWkcsBbqXO4BhU4zQDSK7GMrpcjY= github.com/streamingfast/dmetrics v0.0.0-20250711072030-f023e918a175/go.mod h1:JbxEDbzWRG1dHdNIPrYfuPllEkktZMgm40AwVIBENcw= diff --git a/service/server.go b/service/server.go index aa0642e59..f870cab77 100644 --- a/service/server.go +++ b/service/server.go @@ -3,6 +3,7 @@ package service import ( "context" "fmt" + "net" "net/http" "net/url" "strings" @@ -103,10 +104,45 @@ func ListenTier1( logger.Info("starting secure proxy server", zap.String("address", secureProxyListenAddress)) go func() { - if err := http.ListenAndServe(strings.ReplaceAll(secureProxyListenAddress, "*", ""), handler); err != nil { - logger.Error("failed to start secure proxy server", zap.Error(err)) - grpcServer.Shutdown(0) + cleanAddr := strings.ReplaceAll(secureProxyListenAddress, "*", "") + if strings.Contains(secureProxyListenAddress, "*") { + tcpListener, err := net.Listen("tcp", cleanAddr) + if err != nil { + logger.Error("failed to start secure grpc server", zap.Error(err)) + grpcServer.Shutdown(0) + return + } + + errorLogger, err := zap.NewStdLogAt(logger, zap.ErrorLevel) + if err != nil { + logger.Error("failed to start secure grpc server", zap.Error(err)) + grpcServer.Shutdown(0) + return + } + + h2s := &http2.Server{ + MaxConcurrentStreams: 1000, + } + + httpServer := &http.Server{ + Handler: h2c.NewHandler(rootMux, h2s), + ErrorLog: errorLogger, + } + httpServer.TLSConfig = dgrpcserver.SecuredByBuiltInSelfSignedCertificate().AsTLSConfig() + if err := httpServer.ServeTLS(tcpListener, "", ""); err != nil { + + logger.Error("failed to start secure grpc server", zap.Error(err)) + grpcServer.Shutdown(0) + return + } + + } else { + if err := http.ListenAndServe(cleanAddr, mux); err != nil { + logger.Error("failed to start secure proxy server", zap.Error(err)) + grpcServer.Shutdown(0) + } } + }() logger.Info("starting plaintext proxy server", zap.String("address", plaintextProxyListenAddress)) go func() { @@ -116,6 +152,25 @@ func ListenTier1( } }() + //if s.options.SecureTLSConfig != nil { + // s.logger().Info("serving gRPC (over HTTP router) (encrypted)", zap.String("listen_addr", serverListenerAddress)) + // s.httpServer.TLSConfig = s.options.SecureTLSConfig + // if err := s.httpServer.ServeTLS(tcpListener, "", ""); err != nil { + // s.shutter.Shutdown(fmt.Errorf("gRPC (over HTTP router) serve (TLS) failed: %w", err)) + // return + // } + //} else if s.options.IsPlainText { + // s.logger().Info("serving gRPC (over HTTP router) (plain-text)", zap.String("listen_addr", serverListenerAddress)) + // + // if err := s.httpServer.Serve(tcpListener); err != nil { + // s.shutter.Shutdown(fmt.Errorf("gRPC (over HTTP router) serve failed: %w", err)) + // return + // } + //} else { + // s.shutter.Shutdown(errors.New("invalid server config, server is not plain-text and no TLS config available, something is wrong, this should never happen")) + // return + //} + logger.Info("started") if grpcServer != nil { From 019db3bfd863d3f033313015692bf3aff52179c3 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 11 Feb 2026 13:09:23 -0500 Subject: [PATCH 20/47] Remove unused `fmt` import and debug print statement in server handler. --- service/server.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/service/server.go b/service/server.go index f870cab77..f8924717c 100644 --- a/service/server.go +++ b/service/server.go @@ -2,7 +2,6 @@ package service import ( "context" - "fmt" "net" "net/http" "net/url" @@ -76,7 +75,6 @@ func ListenTier1( mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { contentType := r.Header.Get("Content-Type") logger.Info("handling request", zap.String("content-type", contentType)) - fmt.Println("Grrrrrr: Handling request with content-type:", contentType) if strings.HasPrefix(contentType, "application/grpc") || strings.HasPrefix(contentType, "application/grpc-web") { logger.Debug("forwarding gRPC request") From cc25673ff996be8589ae3f2dfa1bb76d660aff2c Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 11 Feb 2026 13:25:03 -0500 Subject: [PATCH 21/47] Add conditional flushing for single block-scope data in message buffer --- orchestrator/execout/message_buffer.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 624f35c28..55d2a3231 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -52,6 +52,15 @@ func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { b.mut.Lock() defer b.mut.Unlock() + if b.maxBufferedMessage > 2 { + for _, msg := range b.buf.Items { + err := streamSrv.BlockScopedData(msg) + if err != nil { + return fmt.Errorf("flushing single block scope data: %w", err) + } + } + } + err := streamSrv.BlockScopedDatas(b.buf) if err != nil { return fmt.Errorf("flushing buffer: %w", err) From db32338b040450fd4f69049492140a4cce21d759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Wed, 11 Feb 2026 15:34:53 -0500 Subject: [PATCH 22/47] fix vtproto handling for bstream, fix tier1 server addresses listening, disable output message batching by default --- app/tier1.go | 21 ++----- client/client.go | 9 +-- go.mod | 2 +- go.sum | 4 +- go.work.sum | 3 + service/server.go | 156 ++++++++++++++++++---------------------------- service/tier1.go | 4 +- tests_e2e/go.mod | 13 ++-- tests_e2e/go.sum | 26 +++++--- 9 files changed, 102 insertions(+), 136 deletions(-) diff --git a/app/tier1.go b/app/tier1.go index 6f3277aa2..f4e37c5e3 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -88,8 +88,8 @@ type Tier1Config struct { SubrequestsInsecure bool SubrequestsPlaintext bool - SharedCacheSize uint64 - ExecOutMessageBufferSize uint64 + SharedCacheSize uint64 + OutputBundleSize uint64 WASMExtensions wasm.WASMExtensioner Tracing bool @@ -269,7 +269,7 @@ func (a *Tier1App) Run() error { a.config.ActiveRequestsSoftLimit, a.config.ActiveRequestsHardLimit, a.config.SharedCacheSize, - a.config.ExecOutMessageBufferSize, + a.config.OutputBundleSize, a.modules.SessionPool, foundationalStoreEndpoints, opts..., @@ -316,23 +316,12 @@ func (a *Tier1App) Run() error { a.logger.Info("launching gRPC server", zap.Bool("live_support", withLive)) a.setIsReady(true) - secureGrpcProxyAddr := ":9000" - plaintextGrpcProxyAddr := ":8080" - addresses := strings.Split(a.config.GRPCListenAddr, ",") - addressCount := len(addresses) - if addressCount == 0 { + if len(addresses) == 0 { a.logger.Error("no gRPC listen addresses provided") return } - if addressCount > 0 { - secureGrpcProxyAddr = addresses[0] - } - if addressCount > 1 { - plaintextGrpcProxyAddr = addresses[1] - } - - err := service.ListenTier1(secureGrpcProxyAddr, plaintextGrpcProxyAddr, tier1Service, tier1ServiceConnect, infoServer, infoServerConnect, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) + err := service.ListenTier1(addresses, tier1Service, tier1ServiceConnect, infoServer, infoServerConnect, a.modules.Authenticator, a.logger, a.HealthCheck, a.config.EnforceCompression) a.Shutdown(err) }() diff --git a/client/client.go b/client/client.go index 23e53cfff..ce4a51993 100644 --- a/client/client.go +++ b/client/client.go @@ -12,6 +12,7 @@ import ( "github.com/dustin/go-humanize" "github.com/mostynb/go-grpc-compression/experimental/s2" + vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" "github.com/streamingfast/logging/zapx" @@ -24,15 +25,15 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/oauth" xdscreds "google.golang.org/grpc/credentials/xds" + "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/encoding/gzip" stats "google.golang.org/grpc/stats" _ "google.golang.org/grpc/xds" ) -//func init() { -// fmt.Println("------------------ VT Proto registered ------------------------") -// encoding.RegisterCodec(vt.Codec{}) -//} +func init() { + encoding.RegisterCodec(vt.Codec{}) +} type AuthType int diff --git a/go.mod b/go.mod index 834c746fd..5ea5788ad 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/jhump/protoreflect v1.14.0 github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 - github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe + github.com/streamingfast/bstream v0.0.2-0.20260211203220-e95f72b706fa github.com/streamingfast/cli v0.0.4-0.20250815192146-d8a233ec3d0b github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c diff --git a/go.sum b/go.sum index fd0fd0879..18dcec036 100644 --- a/go.sum +++ b/go.sum @@ -549,8 +549,8 @@ github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= -github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe h1:zMPExWZl9RstP9jCVEIUp4DxQoW2Co/8Apsqb+Muntg= -github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe/go.mod h1:0sed+gw+d62tBsGl5omaB1m14Gmfvb3YAs4epHuL1YU= +github.com/streamingfast/bstream v0.0.2-0.20260211203220-e95f72b706fa h1:ih8oxMICJfr/WVoowKeyATHvZ0lbU8+tQCDCgkwJMGU= +github.com/streamingfast/bstream v0.0.2-0.20260211203220-e95f72b706fa/go.mod h1:9NVnl3l3Wljoll+cQb8sccVa078E1m1CgBCFzttGha0= github.com/streamingfast/cli v0.0.4-0.20250815192146-d8a233ec3d0b h1:ztYeX3/5rg2tV2EU7edcrcHzMz6wUbdJB+LqCrP5W8s= github.com/streamingfast/cli v0.0.4-0.20250815192146-d8a233ec3d0b/go.mod h1:o9R/tjNON01X2mgWL5qirl2MV6xQ4EZI5D504ST3K/M= github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 h1:qJmiXzqs3T7124+FXEnhPgK/3fbSjqjQuBTdIrUk4Oc= diff --git a/go.work.sum b/go.work.sum index 33ce3aa69..64d74e12a 100644 --- a/go.work.sum +++ b/go.work.sum @@ -424,6 +424,7 @@ codeberg.org/go-pdf/fpdf v0.10.0/go.mod h1:Y0DGRAdZ0OmnZPvjbMp/1bYxmIPxm0ws4tfoP connectrpc.com/connect v1.11.0/go.mod h1:3AGaO6RRGMx5IKFfqbe3hvK1NqLosFNP2BxDYTPmNPo= connectrpc.com/connect v1.14.0/go.mod h1:uoAq5bmhhn43TwhaKdGKN/bZcGtzPW1v+ngDTn5u+8s= connectrpc.com/connect v1.17.0/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8= +connectrpc.com/connect v1.18.1/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8= contrib.go.opencensus.io/exporter/stackdriver v0.13.10/go.mod h1:I5htMbyta491eUxufwwZPQdcKvvgzMB4O9ni41YnIM8= contrib.go.opencensus.io/exporter/stackdriver v0.13.15-0.20230702191903-2de6d2748484 h1:xRc46S76eyn4ZF3jWX8I+aUSKVLw5EQ1aDvHwfV5W1o= contrib.go.opencensus.io/exporter/stackdriver v0.13.15-0.20230702191903-2de6d2748484/go.mod h1:uxw+4/0SiKbbVSD/F2tk5pJTdVcfIBBcsQ8gwcu4X+E= @@ -985,6 +986,7 @@ github.com/streamingfast/atm v0.0.0-20220131151839-18c87005e680 h1:fGJnUx0shX9Y3 github.com/streamingfast/atm v0.0.0-20220131151839-18c87005e680/go.mod h1:iISPGAstbUsPgyC3auLLi7PYUTi9lHv5z0COam0OPOY= github.com/streamingfast/bstream v0.0.2-0.20231207142002-6844e8db9e20/go.mod h1:08GVb+DXyz6jVNIsbf+2zlaC81UeEGu5o1h49KrSR3Y= github.com/streamingfast/bstream v0.0.2-0.20251218133631-a5f5c59a7c05/go.mod h1:desuTzXOKd0zUbOLKnvhLc1ucQhl454KIdl1KmRw7WY= +github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe/go.mod h1:0sed+gw+d62tBsGl5omaB1m14Gmfvb3YAs4epHuL1YU= github.com/streamingfast/derr v0.0.0-20210811180100-9138d738bcec/go.mod h1:ulVfui/yGXmPBbt9aAqCWdAjM7YxnZkYHzvQktLfw3M= github.com/streamingfast/dgrpc v0.0.0-20250227145723-9bc2e4941b4e/go.mod h1:qdcskj9WmO+nDjgxyafc5oMCftTZolOk693p2ZFUdO8= github.com/streamingfast/dgrpc v0.0.0-20251218133127-15b36e02a74f/go.mod h1:B+RAf6/idk6Kz41wEAEeQH1PW3Bk6WQkmvuRhdTEgKg= @@ -1553,6 +1555,7 @@ google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/ google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= diff --git a/service/server.go b/service/server.go index f8924717c..76e313e11 100644 --- a/service/server.go +++ b/service/server.go @@ -14,6 +14,7 @@ import ( _ "github.com/mostynb/go-grpc-compression/lz4" _ "github.com/mostynb/go-grpc-compression/zstd" _ "github.com/planetscale/vtprotobuf/codec/grpc" + vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dauth" dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" @@ -33,13 +34,13 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" "google.golang.org/grpc" + "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/experimental" ) -//func init() { -// fmt.Println("------------------ VT Proto registered ------------------------") -// encoding.RegisterCodec(vt.Codec{}) -//} +func init() { + encoding.RegisterCodec(vt.Codec{}) +} type streamHandlerV3 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error @@ -56,8 +57,7 @@ func (a *v3Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3 } func ListenTier1( - secureProxyListenAddress string, - plaintextProxyListenAddress string, + listenAddresses []string, svc *Tier1Service, connectSvc *tier1Connect.Service, infoService pbsubstreamsrpc.EndpointInfoServer, @@ -68,8 +68,8 @@ func ListenTier1( enforceCompression bool, ) (err error) { - grpcServer := grpcSever(secureProxyListenAddress, svc, infoService, auth, healthcheck, enforceCompression, logger) - connectServer := connectServer(secureProxyListenAddress, connectSvc, infoServiceConnect, auth, healthcheck, enforceCompression, logger) + grpcServer := grpcServer(svc, infoService, auth, healthcheck, enforceCompression, logger) + connectServer := connectServer(connectSvc, infoServiceConnect, auth, healthcheck, enforceCompression, logger) mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -98,76 +98,53 @@ func ListenTier1( rootMux.Handle("/healthz", grpcServer.HealthHandler()) rootMux.Handle("/", compressionHandler) - handler := h2c.NewHandler(rootMux, &http2.Server{}) - - logger.Info("starting secure proxy server", zap.String("address", secureProxyListenAddress)) - go func() { - cleanAddr := strings.ReplaceAll(secureProxyListenAddress, "*", "") - if strings.Contains(secureProxyListenAddress, "*") { - tcpListener, err := net.Listen("tcp", cleanAddr) - if err != nil { - logger.Error("failed to start secure grpc server", zap.Error(err)) - grpcServer.Shutdown(0) - return - } - - errorLogger, err := zap.NewStdLogAt(logger, zap.ErrorLevel) - if err != nil { - logger.Error("failed to start secure grpc server", zap.Error(err)) - grpcServer.Shutdown(0) - return - } + for _, addr := range listenAddresses { + go func() { h2s := &http2.Server{ MaxConcurrentStreams: 1000, } - - httpServer := &http.Server{ - Handler: h2c.NewHandler(rootMux, h2s), - ErrorLog: errorLogger, - } - httpServer.TLSConfig = dgrpcserver.SecuredByBuiltInSelfSignedCertificate().AsTLSConfig() - if err := httpServer.ServeTLS(tcpListener, "", ""); err != nil { - - logger.Error("failed to start secure grpc server", zap.Error(err)) - grpcServer.Shutdown(0) - return + handler := h2c.NewHandler(rootMux, h2s) + + if strings.Contains(addr, "*") { + cleanAddr := strings.ReplaceAll(addr, "*", "") + tcpListener, err := net.Listen("tcp", cleanAddr) + if err != nil { + logger.Error("failed to start secure grpc server", zap.Error(err)) + grpcServer.Shutdown(0) + return + } + + errorLogger, err := zap.NewStdLogAt(logger, zap.ErrorLevel) + if err != nil { + logger.Error("failed to start secure grpc server", zap.Error(err)) + grpcServer.Shutdown(0) + return + } + + httpServer := &http.Server{ + Handler: handler, + ErrorLog: errorLogger, + TLSConfig: dgrpcserver.SecuredByBuiltInSelfSignedCertificate().AsTLSConfig(), + } + + logger.Info("serving gRPC (over HTTP router) (secure)", zap.String("listen_addr", addr)) + if err := httpServer.ServeTLS(tcpListener, "", ""); err != nil { + logger.Error("failed to start secure grpc server", zap.Error(err)) + grpcServer.Shutdown(0) + return + } + + } else { + logger.Info("serving gRPC (over HTTP router) (plain-text)", zap.String("listen_addr", addr)) + if err := http.ListenAndServe(addr, handler); err != nil { + logger.Error("failed to start secure proxy server", zap.Error(err)) + grpcServer.Shutdown(0) + } } - } else { - if err := http.ListenAndServe(cleanAddr, mux); err != nil { - logger.Error("failed to start secure proxy server", zap.Error(err)) - grpcServer.Shutdown(0) - } - } - - }() - logger.Info("starting plaintext proxy server", zap.String("address", plaintextProxyListenAddress)) - go func() { - if err := http.ListenAndServe(strings.ReplaceAll(plaintextProxyListenAddress, "*", ""), handler); err != nil { - logger.Error("failed to start secure proxy server", zap.Error(err)) - connectServer.Shutdown(0) - } - }() - - //if s.options.SecureTLSConfig != nil { - // s.logger().Info("serving gRPC (over HTTP router) (encrypted)", zap.String("listen_addr", serverListenerAddress)) - // s.httpServer.TLSConfig = s.options.SecureTLSConfig - // if err := s.httpServer.ServeTLS(tcpListener, "", ""); err != nil { - // s.shutter.Shutdown(fmt.Errorf("gRPC (over HTTP router) serve (TLS) failed: %w", err)) - // return - // } - //} else if s.options.IsPlainText { - // s.logger().Info("serving gRPC (over HTTP router) (plain-text)", zap.String("listen_addr", serverListenerAddress)) - // - // if err := s.httpServer.Serve(tcpListener); err != nil { - // s.shutter.Shutdown(fmt.Errorf("gRPC (over HTTP router) serve failed: %w", err)) - // return - // } - //} else { - // s.shutter.Shutdown(errors.New("invalid server config, server is not plain-text and no TLS config available, something is wrong, this should never happen")) - // return - //} + }() + } logger.Info("started") @@ -183,8 +160,7 @@ func ListenTier1( return } -func grpcSever( - address string, +func grpcServer( service *Tier1Service, infoService pbsubstreamsrpc.EndpointInfoServer, auth dauth.Authenticator, @@ -192,7 +168,7 @@ func grpcSever( enforceCompression bool, logger *zap.Logger, ) dgrpcserver.Server { - options := GetCommonServerOptions(address, logger, healthcheck, enforceCompression) + options := GetCommonServerOptions(logger, healthcheck, enforceCompression) options = append(options, dgrpcserver.WithPostUnaryInterceptor(dauthgrpc.UnaryAuthChecker(auth, logger))) options = append(options, dgrpcserver.WithPostStreamInterceptor(dauthgrpc.StreamAuthChecker(auth, logger))) @@ -203,18 +179,11 @@ func grpcSever( pbsubstreamsrpc.RegisterEndpointInfoServer(server.ServiceRegistrar(), infoService) } - cleanAddr := strings.ReplaceAll(address, "*", "") - - service.OnTerminating(func(err error) { - logger.Info("Tier1Service is terminating", zap.String("address", cleanAddr), zap.Error(err)) - server.Shutdown(0) - }) return server } func connectServer( - address string, service *tier1Connect.Service, infoService pbsubstreamsrpcv2connect.EndpointInfoHandler, auth dauth.Authenticator, @@ -222,7 +191,7 @@ func connectServer( enforceCompression bool, logger *zap.Logger, ) dgrpcserver.Server { - options := GetConnectCommonServerOptions(address, logger, healthcheck, enforceCompression) + options := GetConnectCommonServerOptions(logger, healthcheck, enforceCompression) options = append(options, dgrpcserver.WithConnectInterceptor(dauthconnect.NewAuthInterceptor(auth, logger))) options = append(options, dgrpcserver.WithConnectStrictContentType(false)) @@ -285,7 +254,7 @@ func ListenTier2( healthcheck dgrpcserver.HealthCheck, enforceCompression bool, ) (err error) { - options := GetCommonServerOptions(addr, logger, healthcheck, enforceCompression) + options := GetCommonServerOptions(logger, healthcheck, enforceCompression) if serviceDiscoveryURL != nil { options = append(options, dgrpcserver.WithServiceDiscoveryURL(serviceDiscoveryURL)) } @@ -293,6 +262,11 @@ func ListenTier2( dgrpcserver.WithPostUnaryInterceptor(dauthgrpc.UnaryAuthChecker(auth, logger)), dgrpcserver.WithPostStreamInterceptor(dauthgrpc.StreamAuthChecker(auth, logger)), ) + if strings.Contains(addr, "*") { + options = append(options, dgrpcserver.WithInsecureServer()) + } else { + options = append(options, dgrpcserver.WithPlainTextServer()) + } grpcServer := factory.ServerFromOptions(options...) pbssinternal.RegisterSubstreamsServer(grpcServer.ServiceRegistrar(), svc) @@ -315,7 +289,7 @@ func ListenTier2( } -func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { +func GetCommonServerOptions(logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { tracerProvider := otel.GetTracerProvider() options := []dgrpcserver.Option{ @@ -330,15 +304,10 @@ func GetCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck d options = append(options, dgrpcserver.WithEnforceCompression()) } - if strings.Contains(listenAddr, "*") { - options = append(options, dgrpcserver.WithInsecureServer()) - } else { - options = append(options, dgrpcserver.WithPlainTextServer()) - } return options } -func GetConnectCommonServerOptions(listenAddr string, logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { +func GetConnectCommonServerOptions(logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { tracerProvider := otel.GetTracerProvider() options := []dgrpcserver.Option{ dgrpcserver.WithLogger(logger), @@ -348,10 +317,5 @@ func GetConnectCommonServerOptions(listenAddr string, logger *zap.Logger, health grpc.MaxRecvMsgSize(1024*1024*1024), ), } - if strings.Contains(listenAddr, "*") { - options = append(options, dgrpcserver.WithInsecureServer()) - } else { - options = append(options, dgrpcserver.WithPlainTextServer()) - } return options } diff --git a/service/tier1.go b/service/tier1.go index 7ee08cc94..731d2a7e5 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -159,7 +159,7 @@ func NewTier1( activeRequestsSoftLimit int, activeRequestsHardLimit int, sharedCacheSize uint64, - execOutMessageBufferSize uint64, + outputBundleSize uint64, sessionPool dsession.SessionPool, foundationalEndpoints map[string]string, opts ...Option, @@ -217,7 +217,7 @@ func NewTier1( foundationalEndpoints: foundationalEndpoints, sessionPool: sessionPool, activeRequestsManager: active_requests.NewActiveRequestsManager(logger), - execOutMessageBufferSize: int(execOutMessageBufferSize), + execOutMessageBufferSize: int(outputBundleSize), } s.OnTerminating(func(_ error) { s.activeRequestsWG.Wait() diff --git a/tests_e2e/go.mod b/tests_e2e/go.mod index 593fb922a..08af51008 100644 --- a/tests_e2e/go.mod +++ b/tests_e2e/go.mod @@ -13,7 +13,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/testcontainers/testcontainers-go v0.38.0 go.uber.org/zap v1.27.1 - google.golang.org/protobuf v1.36.10 + google.golang.org/protobuf v1.36.11 ) require ( @@ -28,7 +28,7 @@ require ( cloud.google.com/go/monitoring v1.24.2 // indirect cloud.google.com/go/storage v1.59.0 // indirect cloud.google.com/go/trace v1.11.6 // indirect - connectrpc.com/connect v1.18.1 // indirect + connectrpc.com/connect v1.19.1 // indirect connectrpc.com/grpchealth v1.3.0 // indirect connectrpc.com/grpcreflect v1.3.0 // indirect connectrpc.com/otelconnect v0.8.0 // indirect @@ -117,7 +117,8 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jhump/protoreflect v1.14.0 // indirect - github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/compress v1.18.3 // indirect + github.com/klauspost/connect-compress/v2 v2.1.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lithammer/dedent v1.1.0 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect @@ -127,6 +128,7 @@ require ( github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/minio/minlz v1.0.1 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect @@ -147,6 +149,7 @@ require ( github.com/paulbellamy/ratecounter v0.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pinax-network/graph-networks-libs/packages/golang v0.7.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect @@ -173,11 +176,11 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.15.0 // indirect github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect - github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe // indirect + github.com/streamingfast/bstream v0.0.2-0.20260211203220-e95f72b706fa // indirect github.com/streamingfast/cli v0.0.4-0.20250815192146-d8a233ec3d0b // indirect github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c // indirect github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 // indirect - github.com/streamingfast/dgrpc v0.0.0-20251218142640-027692a12722 // indirect + github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd // indirect github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 // indirect github.com/streamingfast/dummy-blockchain v1.7.3 // indirect github.com/streamingfast/firehose-ethereum/types v0.0.0-20251113151010-c9c94d64348a // indirect diff --git a/tests_e2e/go.sum b/tests_e2e/go.sum index 338f9ad3f..8c5fbf9ac 100644 --- a/tests_e2e/go.sum +++ b/tests_e2e/go.sum @@ -62,8 +62,8 @@ cloud.google.com/go/storage v1.59.0 h1:9p3yDzEN9Vet4JnbN90FECIw6n4FCXcKBK1scxtQn cloud.google.com/go/storage v1.59.0/go.mod h1:cMWbtM+anpC74gn6qjLh+exqYcfmB9Hqe5z6adx+CLI= cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4= cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI= -connectrpc.com/connect v1.18.1 h1:PAg7CjSAGvscaf6YZKUefjoih5Z/qYkyaTrBW8xvYPw= -connectrpc.com/connect v1.18.1/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8= +connectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14= +connectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= connectrpc.com/grpchealth v1.3.0 h1:FA3OIwAvuMokQIXQrY5LbIy8IenftksTP/lG4PbYN+E= connectrpc.com/grpchealth v1.3.0/go.mod h1:3vpqmX25/ir0gVgW6RdnCPPZRcR6HvqtXX5RNPmDXHM= connectrpc.com/grpcreflect v1.3.0 h1:Y4V+ACf8/vOb1XOc251Qun7jMB75gCUNw6llvB9csXc= @@ -382,8 +382,10 @@ github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRt github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw= +github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/connect-compress/v2 v2.1.1 h1:ycZNp4rWOZBodVE2Ls5AzK4aHkyK+GteEfzRZgKNs+c= +github.com/klauspost/connect-compress/v2 v2.1.1/go.mod h1:9oilsPHJMzGKkjafSBk9J7iVo4mO+dw0G0KSdVpnlVE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -418,6 +420,8 @@ github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/minio/minlz v1.0.1 h1:OUZUzXcib8diiX+JYxyRLIdomyZYzHct6EShOKtQY2A= +github.com/minio/minlz v1.0.1/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -463,6 +467,8 @@ github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2D github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pinax-network/graph-networks-libs/packages/golang v0.7.0 h1:chRRgzgzmFzICbB/8ybY1IDqvxVgjV415M0AsIYmUHQ= github.com/pinax-network/graph-networks-libs/packages/golang v0.7.0/go.mod h1:G76L6ql7YCygVzN45BmtSBqA+qwcDuFWMM42tDnGJbE= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -524,8 +530,8 @@ github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= -github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe h1:zMPExWZl9RstP9jCVEIUp4DxQoW2Co/8Apsqb+Muntg= -github.com/streamingfast/bstream v0.0.2-0.20260112182417-be2bce62fabe/go.mod h1:0sed+gw+d62tBsGl5omaB1m14Gmfvb3YAs4epHuL1YU= +github.com/streamingfast/bstream v0.0.2-0.20260211203220-e95f72b706fa h1:ih8oxMICJfr/WVoowKeyATHvZ0lbU8+tQCDCgkwJMGU= +github.com/streamingfast/bstream v0.0.2-0.20260211203220-e95f72b706fa/go.mod h1:9NVnl3l3Wljoll+cQb8sccVa078E1m1CgBCFzttGha0= github.com/streamingfast/cli v0.0.4-0.20250815192146-d8a233ec3d0b h1:ztYeX3/5rg2tV2EU7edcrcHzMz6wUbdJB+LqCrP5W8s= github.com/streamingfast/cli v0.0.4-0.20250815192146-d8a233ec3d0b/go.mod h1:o9R/tjNON01X2mgWL5qirl2MV6xQ4EZI5D504ST3K/M= github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 h1:qJmiXzqs3T7124+FXEnhPgK/3fbSjqjQuBTdIrUk4Oc= @@ -534,8 +540,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20251218142640-027692a12722 h1:gZcPR64H5aWs49bLDoNTjhsedTfva7fAIei891LL0C8= -github.com/streamingfast/dgrpc v0.0.0-20251218142640-027692a12722/go.mod h1:NbkvenEHfjQpUBRHTCp/tp0Ayjp5hDzzkv/Ve9Uka1I= +github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd h1:LRu2q7HnzkU/G+K3/m1VrXDszUS8G47v9qAuDI56BXQ= +github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= github.com/streamingfast/dmetering v0.0.0-20251027175535-4fd530934b97 h1:rXZYa87AFt+kluwe4McC9jZgx/eRNSlOkWQaIj9Yv4w= github.com/streamingfast/dmetering v0.0.0-20251027175535-4fd530934b97/go.mod h1:UqWuX3REU/IInBUaymFN2eLjuvz+/0SsoUFjeQlLNyI= github.com/streamingfast/dmetrics v0.0.0-20260109212625-35256f512c62 h1:Tb4T34ImY7qvyrmW53/9ca5CxrXRThuFP1qx64i6FGk= @@ -1001,8 +1007,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.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= -google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= 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= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 865135b57a84c3e8ef6b3b4984397e5977506f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Wed, 11 Feb 2026 16:06:42 -0500 Subject: [PATCH 23/47] handle non-vt grpc messages --- client/client.go | 4 ++-- protodecode/vtcodec.go | 43 ++++++++++++++++++++++++++++++++++++++++++ service/server.go | 4 ++-- 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 protodecode/vtcodec.go diff --git a/client/client.go b/client/client.go index ce4a51993..d10463552 100644 --- a/client/client.go +++ b/client/client.go @@ -12,11 +12,11 @@ import ( "github.com/dustin/go-humanize" "github.com/mostynb/go-grpc-compression/experimental/s2" - vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" "github.com/streamingfast/logging/zapx" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" + "github.com/streamingfast/substreams/protodecode" "go.uber.org/zap" "go.uber.org/zap/zapcore" "golang.org/x/oauth2" @@ -32,7 +32,7 @@ import ( ) func init() { - encoding.RegisterCodec(vt.Codec{}) + encoding.RegisterCodec(protodecode.PreferredVTCodec{}) } type AuthType int diff --git a/protodecode/vtcodec.go b/protodecode/vtcodec.go new file mode 100644 index 000000000..544af6118 --- /dev/null +++ b/protodecode/vtcodec.go @@ -0,0 +1,43 @@ +package protodecode + +import ( + "fmt" + + "google.golang.org/protobuf/proto" +) + +type PreferredVTCodec struct{} + +type vtprotoMessage interface { + MarshalVT() ([]byte, error) + UnmarshalVT([]byte) error +} + +func (PreferredVTCodec) Marshal(v any) ([]byte, error) { + vt, ok := v.(vtprotoMessage) + if !ok { + nonvt, ok := v.(proto.Message) + if ok { + return proto.Marshal(nonvt) + } + return nil, fmt.Errorf("failed to marshal, message is %T (missing proto or vtprotobuf helpers)", v) + } + return vt.MarshalVT() +} + +func (PreferredVTCodec) Unmarshal(data []byte, v any) error { + vt, ok := v.(vtprotoMessage) + if !ok { + nonvt, ok := v.(proto.Message) + if ok { + return proto.Unmarshal(data, nonvt) + } + + return fmt.Errorf("failed to unmarshal, message is %T (missing proto or vtprotobuf helpers)", v) + } + return vt.UnmarshalVT(data) +} + +func (PreferredVTCodec) Name() string { + return "proto" +} diff --git a/service/server.go b/service/server.go index 76e313e11..ff9bd2200 100644 --- a/service/server.go +++ b/service/server.go @@ -14,7 +14,6 @@ import ( _ "github.com/mostynb/go-grpc-compression/lz4" _ "github.com/mostynb/go-grpc-compression/zstd" _ "github.com/planetscale/vtprotobuf/codec/grpc" - vt "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dauth" dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" @@ -27,6 +26,7 @@ import ( "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" + "github.com/streamingfast/substreams/protodecode" tier1Connect "github.com/streamingfast/substreams/service/connect" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" @@ -39,7 +39,7 @@ import ( ) func init() { - encoding.RegisterCodec(vt.Codec{}) + encoding.RegisterCodec(protodecode.PreferredVTCodec{}) } type streamHandlerV3 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error From 468747b4c94843c2b4c1ed92bcd52bd0e6221a53 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 08:06:34 -0500 Subject: [PATCH 24/47] Refactor Tier1 service to support both grpc and connect error handling and removal of unused code --- app/tier1.go | 3 +- service/error.go | 173 +++++++++++++++++ service/server.go | 5 +- .../service.go => service_connect.go} | 64 +++++-- service/service_grpc.go | 73 ++++++++ service/store.go | 26 +++ service/tier1.go | 176 ++---------------- 7 files changed, 332 insertions(+), 188 deletions(-) create mode 100644 service/error.go rename service/{connect/service.go => service_connect.go} (51%) create mode 100644 service/service_grpc.go create mode 100644 service/store.go diff --git a/app/tier1.go b/app/tier1.go index 9393556b8..93813c005 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -26,7 +26,6 @@ import ( "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" "github.com/streamingfast/substreams/reqctx" "github.com/streamingfast/substreams/service" - "github.com/streamingfast/substreams/service/connect" "github.com/streamingfast/substreams/wasm" _ "github.com/streamingfast/substreams/wasm/wasmtime" "github.com/streamingfast/substreams/wasm/wazero" @@ -279,7 +278,7 @@ func (a *Tier1App) Run() error { return err } - tier1ServiceConnect := connect.NewService(tier1Service) + tier1ServiceConnect := service.NewService(tier1Service) a.OnTerminating(func(err error) { metrics.AppReadinessTier1.SetNotReady() diff --git a/service/error.go b/service/error.go new file mode 100644 index 000000000..92ce76313 --- /dev/null +++ b/service/error.go @@ -0,0 +1,173 @@ +package service + +import ( + "context" + "errors" + "fmt" + + "connectrpc.com/connect" + bsstream "github.com/streamingfast/bstream/stream" + "github.com/streamingfast/dgrpc" + "github.com/streamingfast/dsession" + "github.com/streamingfast/substreams/pipeline" + "github.com/streamingfast/substreams/storage/store" + "github.com/streamingfast/substreams/wasm" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// toConnectError turns an `err` into a connect error if it's non-nil, in the `nil` case, +// `nil` is returned right away. +// +// If the `err` has in its chain of error either `context.Canceled`, `context.DeadlineExceeded` +// or `stream.ErrInvalidArg`, error is turned into a proper connect error respectively of code +// `Canceled`, `DeadlineExceeded` or `InvalidArgument`. +// +// If the `err` has in its chain any error constructed through `connect.NewError` (and its variants), then +// we return the first found error of such type directly, because it's already a connect error. +// +// If the `err` has in its chain any error constructed through `grpc` or `status`, it will be converted to connect equivalent. +// +// Otherwise, the error is assumed to be an internal error and turned backed into a proper +// `connect.NewError(connect.CodeInternal, err)`. +func toConnectError(ctx context.Context, err error) error { + if err == nil { + return nil + } + + if errors.Is(err, context.Canceled) { + if contextCause := context.Cause(ctx); contextCause != nil { + err = contextCause // unwrap errors in canceled contexts + if errors.Is(err, context.Canceled) { + return connect.NewError(connect.CodeCanceled, err) + } + } else { + return connect.NewError(connect.CodeCanceled, err) + } + } + + if err, ok := dsession.ToConnectError(err); ok { + return err + } + // special case for context canceled when shutting down + if err == errShuttingDown { + return connect.NewError(connect.CodeUnavailable, err) + } + + // GRPC to connect error + if grpcError := dgrpc.AsGRPCError(err); grpcError != nil { + switch grpcError.Code() { + case codes.Canceled: + return connect.NewError(connect.CodeCanceled, errors.New(grpcError.Message())) + case codes.Unavailable: + return connect.NewError(connect.CodeUnavailable, errors.New(grpcError.Message())) + case codes.InvalidArgument: + return connect.NewError(connect.CodeInvalidArgument, errors.New(grpcError.Message())) + case codes.DeadlineExceeded: + return connect.NewError(connect.CodeDeadlineExceeded, err) + case codes.ResourceExhausted: + return connect.NewError(connect.CodeResourceExhausted, errors.New(grpcError.Message())) + case codes.Unknown: + return connect.NewError(connect.CodeUnknown, errors.New(grpcError.Message())) + } + return grpcError.Err() + } + + // special case for "QuickSave" on shutdown + if err == pipeline.ErrShuttingDown { + return connect.NewError(connect.CodeUnavailable, err) + } + + // context deadline exceeded + if errors.Is(err, context.DeadlineExceeded) { + return connect.NewError(connect.CodeDeadlineExceeded, err) + } + + if errors.Is(err, wasm.ErrWasmDeterministicExec) || errors.Is(err, store.ErrStoreAboveMaxSize) { + return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("%w (deterministic error)", err)) + } + + var errInvalidArg *bsstream.ErrInvalidArg + if errors.As(err, &errInvalidArg) { + return connect.NewError(connect.CodeInvalidArgument, errInvalidArg) + } + + connectError := new(connect.Error) + if errors.As(err, &connectError) { + return connectError + } + + // Do we want to print the full cause as coming from Golang? Would we like to maybe trim off "operational" + // data? + return connect.NewError(connect.CodeInternal, err) +} + +func toGrpcTier1Error(ctx context.Context, err error) error { + if err == nil { + return nil + } + + if errors.Is(err, context.Canceled) { + if contextCause := context.Cause(ctx); contextCause != nil { + err = contextCause // unwrap errors in canceled contexts + if errors.Is(err, context.Canceled) { + return connect.NewError(connect.CodeCanceled, err) + } + } else { + return connect.NewError(connect.CodeCanceled, err) + } + } + + grpcError := func(err error) (error, bool) { + // Handle session pool errors + if errors.Is(err, dsession.ErrUnavailable) { + return status.Error(codes.Unavailable, err.Error()), true + } + if errors.Is(err, dsession.ErrPermissionDenied) { + return status.Error(codes.PermissionDenied, err.Error()), true + } + if errors.Is(err, dsession.ErrQuotaExceeded) { + return status.Error(codes.ResourceExhausted, err.Error()), true + } + if errors.Is(err, dsession.ErrConcurrentStreamLimitExceeded) { + return status.Error(codes.ResourceExhausted, err.Error()), true + } + return err, false + } + + if err, ok := grpcError(err); ok { + return err + } + // special case for context canceled when shutting down + if errors.Is(err, errShuttingDown) { + return status.Error(codes.Unavailable, err.Error()) + } + + // GRPC to connect error + if grpcError := dgrpc.AsGRPCError(err); grpcError != nil { + return grpcError.Err() + } + + // special case for "QuickSave" on shutdown + if errors.Is(err, pipeline.ErrShuttingDown) { + return status.Error(codes.Unavailable, err.Error()) + } + + // context deadline exceeded + if errors.Is(err, context.DeadlineExceeded) { + return status.Error(codes.DeadlineExceeded, err.Error()) + } + + if errors.Is(err, wasm.ErrWasmDeterministicExec) || errors.Is(err, store.ErrStoreAboveMaxSize) { + return status.Errorf(codes.InvalidArgument, "%s (deterministic error)", err) + } + + var errInvalidArg *bsstream.ErrInvalidArg + if errors.As(err, &errInvalidArg) { + return status.Error(codes.InvalidArgument, errInvalidArg.Error()) + } + + // Do we want to print the full cause as coming from Golang? Would we like to maybe trim off "operational" + // data? + return status.Error(codes.Internal, err.Error()) +} diff --git a/service/server.go b/service/server.go index ff9bd2200..f470f1aaf 100644 --- a/service/server.go +++ b/service/server.go @@ -27,7 +27,6 @@ import ( pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" "github.com/streamingfast/substreams/protodecode" - tier1Connect "github.com/streamingfast/substreams/service/connect" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" "go.uber.org/zap" @@ -59,7 +58,7 @@ func (a *v3Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3 func ListenTier1( listenAddresses []string, svc *Tier1Service, - connectSvc *tier1Connect.Service, + connectSvc *ConnectService, infoService pbsubstreamsrpc.EndpointInfoServer, infoServiceConnect pbsubstreamsrpcv2connect.EndpointInfoHandler, auth dauth.Authenticator, @@ -184,7 +183,7 @@ func grpcServer( } func connectServer( - service *tier1Connect.Service, + service *ConnectService, infoService pbsubstreamsrpcv2connect.EndpointInfoHandler, auth dauth.Authenticator, healthcheck dgrpcserver.HealthCheck, diff --git a/service/connect/service.go b/service/service_connect.go similarity index 51% rename from service/connect/service.go rename to service/service_connect.go index 7fc7450c4..4f003c46e 100644 --- a/service/connect/service.go +++ b/service/service_connect.go @@ -1,4 +1,4 @@ -package connect +package service import ( "context" @@ -12,38 +12,28 @@ import ( "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "github.com/streamingfast/substreams/reqctx" + "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) -type Tier1Service interface { - BlocksAny( - ctx context.Context, - request *pbsubstreamsrpc.Request, - header http.Header, - protocol string, - pkg *pbsubstreams.Package, - stream grpc.ServerStream, - ) error +type ConnectService struct { + inner *Tier1Service } -type Service struct { - inner Tier1Service +func NewService(inner *Tier1Service) *ConnectService { + return &ConnectService{inner: inner} } -func NewService(inner Tier1Service) *Service { - return &Service{inner: inner} -} - -func (s *Service) Blocks( +func (s *ConnectService) Blocks( ctx context.Context, req *connect.Request[pbsubstreamsrpc.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response], ) error { - return s.inner.BlocksAny(ctx, req.Msg, req.Header(), pbsubstreamsrpcv2connect.StreamBlocksProcedure, nil, &serverStreamWrapper{stream, ctx}) + return s.inner.BlocksAnyConnect(ctx, req.Msg, req.Header(), pbsubstreamsrpcv2connect.StreamBlocksProcedure, nil, &serverStreamWrapper{stream, ctx}) } -func (s *Service) BlocksV3( +func (s *ConnectService) BlocksV3( ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response], @@ -59,7 +49,7 @@ func (s *Service) BlocksV3( return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("failed to convert request to v2: %w", err)) } - return s.inner.BlocksAny(ctx, v2req, req.Header(), pbsubstreamsrpcv3connect.StreamBlocksProcedure, req.Msg.Package, &serverStreamWrapper{stream, ctx}) + return s.inner.BlocksAnyConnect(ctx, v2req, req.Header(), pbsubstreamsrpcv3connect.StreamBlocksProcedure, req.Msg.Package, &serverStreamWrapper{stream, ctx}) } type serverStreamWrapper struct { @@ -89,3 +79,37 @@ func (w *serverStreamWrapper) SendMsg(m interface{}) error { func (w *serverStreamWrapper) RecvMsg(m interface{}) error { return fmt.Errorf("not implemented") } + +func (s *Tier1Service) BlocksAnyConnect( + ctx context.Context, + request *pbsubstreamsrpc.Request, + header http.Header, + protocol string, + pkg *pbsubstreams.Package, + stream grpc.ServerStream, +) (serverErr error) { + + logger := reqctx.Logger(ctx).Named("tier1-connect") + runningCtx, err, blockErr := s.BlocksAny(ctx, request, header, protocol, pkg, stream, logger) + if err != nil { + return err + } + + if connectError := toConnectError(runningCtx, err); connectError != nil { + switch connect.CodeOf(connectError) { + case connect.CodeInternal: + logger.Warn("unexpected termination of stream of blocks", zap.String("stream_processor", "tier1"), zap.Error(err)) + case connect.CodeInvalidArgument: + logger.Debug("invalid argument on request", zap.Error(connectError)) + case connect.CodeCanceled: + logger.Debug("Blocks request canceled by user", zap.Error(connectError)) + case connect.CodeResourceExhausted: + logger.Debug("Blocks request failed with ResourceExhausted", zap.Error(connectError)) + default: + logger.Warn("Blocks request completed with error", zap.Error(connectError)) + } + return connectError + } + + return blockErr +} diff --git a/service/service_grpc.go b/service/service_grpc.go new file mode 100644 index 000000000..ac81a5351 --- /dev/null +++ b/service/service_grpc.go @@ -0,0 +1,73 @@ +package service + +import ( + "context" + "net/http" + + "github.com/streamingfast/substreams/manifest" + pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" + "github.com/streamingfast/substreams/reqctx" + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (s *Tier1Service) Blocks(req *pbsubstreamsrpc.Request, srv pbsubstreamsrpc.Stream_BlocksServer) error { + ctx := srv.Context() + header := metadataToHeader(ctx) + protocol := "/sf.substreams.rpc.v2.Stream/Blocks" + return s.BlocksAnyGrpc(ctx, req, header, protocol, nil, srv) +} + +func (s *Tier1Service) BlocksV3(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3.Stream_BlocksServer) error { + _, err := manifest.ApplyPackageTransformations(req.Package, false, req.Network, req.OutputModule, req.Params) + if err != nil { + return status.Errorf(codes.InvalidArgument, "%v", err) + } + ctx := srv.Context() + ctx = reqctx.WithSpkg(ctx, req.Package) + v2req, err := req.ToV2() + if err != nil { + return status.Errorf(codes.InvalidArgument, "failed to convert request to v2: %s", err) + } + header := metadataToHeader(ctx) + protocol := "/sf.substreams.rpc.v3.Stream/Blocks" + return s.BlocksAnyGrpc(ctx, v2req, header, protocol, req.Package, srv) +} + +func (s *Tier1Service) BlocksAnyGrpc( + ctx context.Context, + request *pbsubstreamsrpc.Request, + header http.Header, + protocol string, + pkg *pbsubstreams.Package, + stream grpc.ServerStream, +) (serverErr error) { + + logger := reqctx.Logger(ctx).Named("tier1-grpc") + runningCtx, err, blockErr := s.BlocksAny(ctx, request, header, protocol, pkg, stream, logger) + if err != nil { + return err + } + + if grpcErr := toGrpcTier1Error(runningCtx, err); grpcErr != nil { + switch status.Code(grpcErr) { + case codes.Internal: + logger.Warn("unexpected termination of stream of blocks", zap.String("stream_processor", "tier1"), zap.Error(err)) + case codes.InvalidArgument: + logger.Debug("invalid argument on request", zap.Error(grpcErr)) + case codes.Canceled: + logger.Debug("Blocks request canceled by user", zap.Error(grpcErr)) + case codes.ResourceExhausted: + logger.Debug("Blocks request failed with ResourceExhausted", zap.Error(grpcErr)) + default: + logger.Warn("Blocks request completed with error", zap.Error(grpcErr)) + } + return grpcErr + } + + return blockErr +} diff --git a/service/store.go b/service/store.go new file mode 100644 index 000000000..e3651c572 --- /dev/null +++ b/service/store.go @@ -0,0 +1,26 @@ +package service + +import "go.uber.org/zap/zapcore" + +type usedStore struct { + Name string + Hash string +} + +func (s *usedStore) MarshalLogObject(e zapcore.ObjectEncoder) error { + e.AddString("name", s.Name) + e.AddString("hash", s.Hash) + return nil +} + +type UsedFoundationalStore struct { + Identifier string + ModuleHash string +} + +func (s *UsedFoundationalStore) MarshalLogObject(e zapcore.ObjectEncoder) error { + e.AddString("identifier", s.Identifier) + e.AddString("module_hash", s.ModuleHash) + + return nil +} diff --git a/service/tier1.go b/service/tier1.go index 731d2a7e5..c3d8c2f28 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -23,7 +23,6 @@ import ( "github.com/streamingfast/bstream/stream" bsstream "github.com/streamingfast/bstream/stream" "github.com/streamingfast/dauth" - "github.com/streamingfast/dgrpc" "github.com/streamingfast/dmetering" "github.com/streamingfast/dmetrics" "github.com/streamingfast/dsession" @@ -40,7 +39,6 @@ import ( "github.com/streamingfast/substreams/orchestrator/plan" "github.com/streamingfast/substreams/orchestrator/work" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" - pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "github.com/streamingfast/substreams/pipeline" "github.com/streamingfast/substreams/pipeline/cache" @@ -54,11 +52,8 @@ import ( "go.opentelemetry.io/otel/attribute" ttrace "go.opentelemetry.io/otel/trace" "go.uber.org/zap" - "go.uber.org/zap/zapcore" "google.golang.org/grpc" - "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) @@ -303,52 +298,6 @@ func metadataToHeader(ctx context.Context) http.Header { return h } -func (s *Tier1Service) Blocks(req *pbsubstreamsrpc.Request, srv pbsubstreamsrpc.Stream_BlocksServer) error { - ctx := srv.Context() - header := metadataToHeader(ctx) - protocol := "/sf.substreams.rpc.v2.Stream/Blocks" - return s.BlocksAny(ctx, req, header, protocol, nil, srv) -} - -func (s *Tier1Service) BlocksV3(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3.Stream_BlocksServer) error { - _, err := manifest.ApplyPackageTransformations(req.Package, false, req.Network, req.OutputModule, req.Params) - if err != nil { - return status.Errorf(codes.InvalidArgument, "%v", err) - } - ctx := srv.Context() - ctx = reqctx.WithSpkg(ctx, req.Package) - v2req, err := req.ToV2() - if err != nil { - return status.Errorf(codes.InvalidArgument, "failed to convert request to v2: %s", err) - } - header := metadataToHeader(ctx) - protocol := "/sf.substreams.rpc.v3.Stream/Blocks" - return s.BlocksAny(ctx, v2req, header, protocol, req.Package, srv) -} - -type usedStore struct { - Name string - Hash string -} - -func (s *usedStore) MarshalLogObject(e zapcore.ObjectEncoder) error { - e.AddString("name", s.Name) - e.AddString("hash", s.Hash) - return nil -} - -type UsedFoundationalStore struct { - Identifier string - ModuleHash string -} - -func (s *UsedFoundationalStore) MarshalLogObject(e zapcore.ObjectEncoder) error { - e.AddString("identifier", s.Identifier) - e.AddString("module_hash", s.ModuleHash) - - return nil -} - func (s *Tier1Service) BlocksAny( ctx context.Context, request *pbsubstreamsrpc.Request, @@ -356,7 +305,8 @@ func (s *Tier1Service) BlocksAny( protocol string, pkg *pbsubstreams.Package, stream grpc.ServerStream, -) (serverErr error) { + logger *zap.Logger, +) (runningCtx context.Context, serverErr error, blockErr error) { if s.IsTerminating() { serverErr = connect.NewError(connect.CodeUnavailable, errShuttingDown) return @@ -377,14 +327,12 @@ func (s *Tier1Service) BlocksAny( // and not only the `grpcError` one which is a subset view of the full `err`. var err error - logger := reqctx.Logger(ctx).Named("tier1") - envEthCallFallbackToLatestDuration := os.Getenv(EnvEthCallFallbackToLatestDuration) fallbackDuration := time.Duration(0) if envEthCallFallbackToLatestDuration != "" { fallbackDuration, err = time.ParseDuration(envEthCallFallbackToLatestDuration) if err != nil { - return fmt.Errorf("invalid value for env var %s: %w", EnvEthCallFallbackToLatestDuration, err) + return nil, fmt.Errorf("invalid value for env var %s: %w", EnvEthCallFallbackToLatestDuration, err), nil } } @@ -393,7 +341,7 @@ func (s *Tier1Service) BlocksAny( if envEthCallUseBlockNumberDuration != "" { useBlockNumberDuration, err = time.ParseDuration(envEthCallUseBlockNumberDuration) if err != nil { - return fmt.Errorf("invalid value for env var %s: %w", EnvEthCallUseBlockNumberDuration, err) + return nil, fmt.Errorf("invalid value for env var %s: %w", EnvEthCallUseBlockNumberDuration, err), nil } } @@ -425,7 +373,7 @@ func (s *Tier1Service) BlocksAny( err := connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("missing modules in request")) fields = append(fields, zap.Error(err)) logger.Info("refusing Substreams Blocks request", fields...) - return err + return nil, err, nil } if auth := dauth.FromContext(ctx); auth != nil { @@ -460,7 +408,7 @@ func (s *Tier1Service) BlocksAny( err := connect.NewError(connect.CodeUnavailable, fmt.Errorf("service under heavy load, please try connecting again")) fields = append(fields, zap.Error(err), zap.Int("active_request_count", stat.activeRequestCount), zap.Int("hard_limit", stat.hardLimit)) logger.Info("refusing Substreams Blocks request", fields...) - return err + return nil, err, nil } execGraph, err := exec.NewOutputModuleGraph(request.OutputModule, request.ProductionMode, request.Modules, bstream.GetProtocolFirstStreamableBlock) @@ -468,7 +416,7 @@ func (s *Tier1Service) BlocksAny( err := connect.NewError(connect.CodeInvalidArgument, err) fields = append(fields, zap.Error(err)) logger.Info("refusing Substreams Blocks request", fields...) - return err + return nil, err, nil } outputModuleHash := execGraph.ModuleHashes()[request.OutputModule] @@ -548,14 +496,14 @@ func (s *Tier1Service) BlocksAny( if err := ValidateTier1Request(request, s.blockType); err != nil { err := connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("validate request: %w", err)) logger.Info("refusing Substreams Blocks request", append(fields, zap.Error(err))...) - return err + return nil, err, nil } if envEthCallFallbackToLatestDuration != "" && hasEthCall(request.Modules.Binaries) { if header.Get("X-substreams-acknowledge-non-deterministic") != "true" { err := connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("header X-substreams-acknowledge-non-deterministic must be set to true when using eth_call or eth_get_balance on a non deterministic rpc provider")) logger.Info("refusing Substreams Blocks request", append(fields, zap.Error(err))...) - return err + return nil, err, nil } } @@ -589,24 +537,12 @@ func (s *Tier1Service) BlocksAny( respFunc := tier1ResponseHandler(respContext, &mut, logger, stream, request.NoopMode, reqStats, request.DevOutputModules) err = s.blocks(runningContext, cancelRunning, request, header, execGraph, respFunc, reqStats, fields, s.execOutMessageBufferSize) - - if connectError := toConnectError(runningContext, err); connectError != nil { - switch connect.CodeOf(connectError) { - case connect.CodeInternal: - logger.Warn("unexpected termination of stream of blocks", zap.String("stream_processor", "tier1"), zap.Error(err)) - case connect.CodeInvalidArgument: - logger.Debug("invalid argument on request", zap.Error(connectError)) - case connect.CodeCanceled: - logger.Debug("Blocks request canceled by user", zap.Error(connectError)) - case connect.CodeResourceExhausted: - logger.Debug("Blocks request failed with ResourceExhausted", zap.Error(connectError)) - default: - logger.Warn("Blocks request completed with error", zap.Error(connectError)) - } - return connectError + if err != nil { + return runningContext, nil, err } + logger.Debug("Blocks request completed without error") - return nil + return runningContext, nil, nil } func compressorsFromHeader(header http.Header) (out map[string]bool) { @@ -1296,92 +1232,6 @@ func setupRequestStats(ctx context.Context, outputModuleName, outputModuleHash s return reqctx.WithReqStats(ctx, stats), stats } -// toConnectError turns an `err` into a connect error if it's non-nil, in the `nil` case, -// `nil` is returned right away. -// -// If the `err` has in its chain of error either `context.Canceled`, `context.DeadlineExceeded` -// or `stream.ErrInvalidArg`, error is turned into a proper connect error respectively of code -// `Canceled`, `DeadlineExceeded` or `InvalidArgument`. -// -// If the `err` has in its chain any error constructed through `connect.NewError` (and its variants), then -// we return the first found error of such type directly, because it's already a connect error. -// -// If the `err` has in its chain any error constructed through `grpc` or `status`, it will be converted to connect equivalent. -// -// Otherwise, the error is assumed to be an internal error and turned backed into a proper -// `connect.NewError(connect.CodeInternal, err)`. -func toConnectError(ctx context.Context, err error) error { - if err == nil { - return nil - } - - if errors.Is(err, context.Canceled) { - if contextCause := context.Cause(ctx); contextCause != nil { - err = contextCause // unwrap errors in canceled contexts - if errors.Is(err, context.Canceled) { - return connect.NewError(connect.CodeCanceled, err) - } - } else { - return connect.NewError(connect.CodeCanceled, err) - } - } - - if err, ok := dsession.ToConnectError(err); ok { - return err - } - // special case for context canceled when shutting down - if err == errShuttingDown { - return connect.NewError(connect.CodeUnavailable, err) - } - - // GRPC to connect error - if grpcError := dgrpc.AsGRPCError(err); grpcError != nil { - switch grpcError.Code() { - case codes.Canceled: - return connect.NewError(connect.CodeCanceled, errors.New(grpcError.Message())) - case codes.Unavailable: - return connect.NewError(connect.CodeUnavailable, errors.New(grpcError.Message())) - case codes.InvalidArgument: - return connect.NewError(connect.CodeInvalidArgument, errors.New(grpcError.Message())) - case codes.DeadlineExceeded: - return connect.NewError(connect.CodeDeadlineExceeded, err) - case codes.ResourceExhausted: - return connect.NewError(connect.CodeResourceExhausted, errors.New(grpcError.Message())) - case codes.Unknown: - return connect.NewError(connect.CodeUnknown, errors.New(grpcError.Message())) - } - return grpcError.Err() - } - - // special case for "QuickSave" on shutdown - if err == pipeline.ErrShuttingDown { - return connect.NewError(connect.CodeUnavailable, err) - } - - // context deadline exceeded - if errors.Is(err, context.DeadlineExceeded) { - return connect.NewError(connect.CodeDeadlineExceeded, err) - } - - if errors.Is(err, wasm.ErrWasmDeterministicExec) || errors.Is(err, store.ErrStoreAboveMaxSize) { - return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("%w (deterministic error)", err)) - } - - var errInvalidArg *bsstream.ErrInvalidArg - if errors.As(err, &errInvalidArg) { - return connect.NewError(connect.CodeInvalidArgument, errInvalidArg) - } - - connectError := new(connect.Error) - if errors.As(err, &connectError) { - return connectError - } - - // Do we want to print the full cause as coming from Golang? Would we like to maybe trim off "operational" - // data? - return connect.NewError(connect.CodeInternal, err) -} - type overloadingStatus struct { // set only if either soft or hard limit set is > 0 activeRequestCount int From c73528ea7ddab45a991e9660430b3f8803e14585 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 08:31:44 -0500 Subject: [PATCH 25/47] Add `DataSize` tracking to `MessageBuffer` for improved flushing control --- orchestrator/execout/execout_walker.go | 2 +- orchestrator/execout/message_buffer.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/orchestrator/execout/execout_walker.go b/orchestrator/execout/execout_walker.go index 8cdaaa06b..643205543 100644 --- a/orchestrator/execout/execout_walker.go +++ b/orchestrator/execout/execout_walker.go @@ -259,7 +259,7 @@ func (r *Walker) sendItems(reader execout.FileReader) error { return fmt.Errorf("converting to block scoped data: %w", err) } - r.buffer.Append(blockScopedData) + r.buffer.Append(blockScopedData, len(item.Payload)) if r.buffer.ShouldFlush() { err := r.buffer.Flush(r.streamOut) if err != nil { diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 55d2a3231..e8d9c4187 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -14,6 +14,7 @@ type MessageBuffer struct { buf *pbsubstreamsrpcv2.BlockScopedDatas lastFlush time.Time maxBufferedMessage int + DataSize int } func NewMessageBuffer(maxBufferedMessage int) *MessageBuffer { @@ -30,10 +31,11 @@ func (b *MessageBuffer) Len() int { return len(b.buf.Items) } -func (b *MessageBuffer) Append(msg *pbsubstreamsrpcv2.BlockScopedData) { +func (b *MessageBuffer) Append(msg *pbsubstreamsrpcv2.BlockScopedData, dataSize int) { b.mut.Lock() defer b.mut.Unlock() + b.DataSize += dataSize b.buf.Items = append(b.buf.Items, msg) } @@ -41,6 +43,10 @@ func (b *MessageBuffer) ShouldFlush() bool { b.mut.Lock() defer b.mut.Unlock() + if b.DataSize > 1024*1024*1024 { + return true + } + if len(b.buf.Items) > b.maxBufferedMessage { return true } @@ -67,6 +73,7 @@ func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { } b.lastFlush = time.Now() + b.DataSize = 0 b.buf = &pbsubstreamsrpcv2.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}} return nil From e78f613db3121ed498acd32ece5385a326938810 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 08:43:26 -0500 Subject: [PATCH 26/47] Fix incorrect comparison operator in `MessageBuffer` flushing condition --- orchestrator/execout/message_buffer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index e8d9c4187..15cd8d853 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -58,7 +58,7 @@ func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { b.mut.Lock() defer b.mut.Unlock() - if b.maxBufferedMessage > 2 { + if b.maxBufferedMessage < 2 { for _, msg := range b.buf.Items { err := streamSrv.BlockScopedData(msg) if err != nil { From 42960e7adddadb24f936c4da53092cdda96d73db Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 09:02:15 -0500 Subject: [PATCH 27/47] Add logging to `MessageBuffer` and adjust buffer flushing data size limit --- orchestrator/execout/execout_walker.go | 7 +------ orchestrator/execout/message_buffer.go | 8 ++++++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/orchestrator/execout/execout_walker.go b/orchestrator/execout/execout_walker.go index 643205543..2a0481cf4 100644 --- a/orchestrator/execout/execout_walker.go +++ b/orchestrator/execout/execout_walker.go @@ -53,12 +53,7 @@ func NewWalker( streamOut: stream, noopMode: noopMode, logger: logger, - buffer: NewMessageBuffer(func() int { - if bufferSize <= 0 { - return 100 - } - return bufferSize - }()), + buffer: NewMessageBuffer(bufferSize, logger), } } diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 15cd8d853..0c8d3b0b7 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -7,6 +7,7 @@ import ( "github.com/streamingfast/substreams/orchestrator/response" pbsubstreamsrpcv2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + "go.uber.org/zap" ) type MessageBuffer struct { @@ -15,12 +16,14 @@ type MessageBuffer struct { lastFlush time.Time maxBufferedMessage int DataSize int + logger *zap.Logger } -func NewMessageBuffer(maxBufferedMessage int) *MessageBuffer { +func NewMessageBuffer(maxBufferedMessage int, logger *zap.Logger) *MessageBuffer { return &MessageBuffer{ buf: &pbsubstreamsrpcv2.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}}, maxBufferedMessage: maxBufferedMessage, + logger: logger.Named("message-buffer"), } } @@ -43,7 +46,8 @@ func (b *MessageBuffer) ShouldFlush() bool { b.mut.Lock() defer b.mut.Unlock() - if b.DataSize > 1024*1024*1024 { + if b.DataSize > 1024*1024*10 { + b.logger.Info("flushing due to large data size", zap.Int("data_size", b.DataSize), zap.Bool("keep", false)) return true } From 70bc4e3c7b9a93d128897d3800fb1ed73a45e03e Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 09:20:20 -0500 Subject: [PATCH 28/47] Update `MessageBuffer` to reduce flushing data size limit to 1MB --- orchestrator/execout/message_buffer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 0c8d3b0b7..c1a817ca7 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -46,7 +46,7 @@ func (b *MessageBuffer) ShouldFlush() bool { b.mut.Lock() defer b.mut.Unlock() - if b.DataSize > 1024*1024*10 { + if b.DataSize > 1024*1024 { b.logger.Info("flushing due to large data size", zap.Int("data_size", b.DataSize), zap.Bool("keep", false)) return true } From 1031afa230ab620f343bacce5f5ac59ce6eb3e98 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 09:31:44 -0500 Subject: [PATCH 29/47] Adjust `MessageBuffer` data size limit for flushing and switch logging to debug level --- orchestrator/execout/message_buffer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index c1a817ca7..2f1abc725 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -46,8 +46,8 @@ func (b *MessageBuffer) ShouldFlush() bool { b.mut.Lock() defer b.mut.Unlock() - if b.DataSize > 1024*1024 { - b.logger.Info("flushing due to large data size", zap.Int("data_size", b.DataSize), zap.Bool("keep", false)) + if b.DataSize > 1024*1024*10 { + b.logger.Debug("flushing due to large data size", zap.Int("data_size", b.DataSize), zap.Bool("keep", false)) return true } From 4ab9773bae797ce1dcf69490977b23ed7b14c5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Thu, 12 Feb 2026 09:52:44 -0500 Subject: [PATCH 30/47] fix connect/grpc error handling --- service/error.go | 55 ++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/service/error.go b/service/error.go index 92ce76313..1fcb00887 100644 --- a/service/error.go +++ b/service/error.go @@ -118,36 +118,49 @@ func toGrpcTier1Error(ctx context.Context, err error) error { } } - grpcError := func(err error) (error, bool) { - // Handle session pool errors - if errors.Is(err, dsession.ErrUnavailable) { - return status.Error(codes.Unavailable, err.Error()), true - } - if errors.Is(err, dsession.ErrPermissionDenied) { - return status.Error(codes.PermissionDenied, err.Error()), true - } - if errors.Is(err, dsession.ErrQuotaExceeded) { - return status.Error(codes.ResourceExhausted, err.Error()), true - } - if errors.Is(err, dsession.ErrConcurrentStreamLimitExceeded) { - return status.Error(codes.ResourceExhausted, err.Error()), true + // GRPC error directly + if grpcError := dgrpc.AsGRPCError(err); grpcError != nil { + return err + } + + // convert connectWeb error + connectError := new(connect.Error) + if errors.As(err, &connectError) { + switch connectError.Code() { + case connect.CodeCanceled: + return status.Error(codes.Canceled, connectError.Message()) + case connect.CodeUnavailable: + return status.Error(codes.Unavailable, connectError.Message()) + case connect.CodeInvalidArgument: + return status.Error(codes.InvalidArgument, connectError.Message()) + case connect.CodeDeadlineExceeded: + return status.Error(codes.DeadlineExceeded, connectError.Message()) + case connect.CodeResourceExhausted: + return status.Error(codes.ResourceExhausted, connectError.Message()) + default: + return status.Error(codes.Unknown, connectError.Message()) } - return err, false } - if err, ok := grpcError(err); ok { - return err + // convert dsession error + if errors.Is(err, dsession.ErrUnavailable) { + return status.Error(codes.Unavailable, err.Error()) + } + if errors.Is(err, dsession.ErrPermissionDenied) { + return status.Error(codes.PermissionDenied, err.Error()) + } + if errors.Is(err, dsession.ErrQuotaExceeded) { + return status.Error(codes.ResourceExhausted, err.Error()) } + if errors.Is(err, dsession.ErrConcurrentStreamLimitExceeded) { + return status.Error(codes.ResourceExhausted, err.Error()) + } + // special case for context canceled when shutting down if errors.Is(err, errShuttingDown) { return status.Error(codes.Unavailable, err.Error()) } - // GRPC to connect error - if grpcError := dgrpc.AsGRPCError(err); grpcError != nil { - return grpcError.Err() - } - // special case for "QuickSave" on shutdown if errors.Is(err, pipeline.ErrShuttingDown) { return status.Error(codes.Unavailable, err.Error()) From 10f12409b498a9f4fdcd2b04be08dae75e100d66 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 10:17:46 -0500 Subject: [PATCH 31/47] Refactor `MessageBuffer` flushing logic and enhance integration test output handling --- orchestrator/execout/execout_walker.go | 3 --- orchestrator/execout/message_buffer.go | 10 +++++----- test/integration_test.go | 5 ++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/orchestrator/execout/execout_walker.go b/orchestrator/execout/execout_walker.go index 2a0481cf4..e84e1a265 100644 --- a/orchestrator/execout/execout_walker.go +++ b/orchestrator/execout/execout_walker.go @@ -261,9 +261,6 @@ func (r *Walker) sendItems(reader execout.FileReader) error { return fmt.Errorf("flushing buffer: %w", err) } } - if err = r.streamOut.BlockScopedData(blockScopedData); err != nil { - return fmt.Errorf("calling response func: %w", err) - } itemCount++ if r.noopMode { diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 2f1abc725..76d725759 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -69,11 +69,11 @@ func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { return fmt.Errorf("flushing single block scope data: %w", err) } } - } - - err := streamSrv.BlockScopedDatas(b.buf) - if err != nil { - return fmt.Errorf("flushing buffer: %w", err) + } else { + err := streamSrv.BlockScopedDatas(b.buf) + if err != nil { + return fmt.Errorf("flushing buffer: %w", err) + } } b.lastFlush = time.Now() diff --git a/test/integration_test.go b/test/integration_test.go index ca77558d6..479e556ca 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -385,7 +385,10 @@ func TestOneStoreOneMap(t *testing.T) { assert.Equal(t, value, meteringEvents[key], key) } } - + parts := strings.Split(mapOutput, "\n") + for _, part := range parts { + fmt.Println(part) + } assert.Equal(t, test.expectedResponseCount, strings.Count(mapOutput, "\n")) withZST := func(s []string) []string { From 843bb31d58f58f7b373adf9ba89fa9303f55757f Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 11:20:51 -0500 Subject: [PATCH 32/47] Make `messageLimit` configurable via environment variable and add `session_id` to Tier1 debug logs --- client/client.go | 17 ++++++++++++++--- service/tier1.go | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/client/client.go b/client/client.go index d10463552..616ab487a 100644 --- a/client/client.go +++ b/client/client.go @@ -8,6 +8,7 @@ import ( "net/url" "os" "regexp" + "strconv" "time" "github.com/dustin/go-humanize" @@ -174,6 +175,7 @@ func (c *SubstreamsClientConfig) MarshalLogObject(encoder zapcore.ObjectEncoder) } type sizeLoggingHandler struct { + messageLimit int messageCount int timeStart time.Time @@ -202,7 +204,7 @@ func (h *sizeLoggingHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { h.compressedBytes += inPayload.CompressedLength h.wireBytes += inPayload.WireLength - if h.messageCount == 10000 { + if h.messageCount == h.messageLimit { secs := time.Since(h.timeStart).Seconds() messagesPerSecond := float64(h.messageCount) / secs compressedPercentage := 100.0 - (float64(h.compressedBytes) / float64(h.uncompressedBytes) * 100.0) @@ -432,8 +434,17 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close dialOptions = []grpc.DialOption{grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{InsecureSkipVerify: true}))} } } - - sizeHandler := &sizeLoggingHandler{} + messageLimitString := os.Getenv("GRPC_SIZE_LOGGER_MESSAGE_LIMIT") + messageLimit := 10000 + if messageLimitString != "" { + messageLimit, err = strconv.Atoi(messageLimitString) + if err != nil { + return nil, nil, nil, nil, fmt.Errorf("failed to parse GRPC_SIZE_LOGGER_MESSAGE_LIMIT: %w", err) + } + } + sizeHandler := &sizeLoggingHandler{ + messageLimit: messageLimit, + } dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) //compressor := os.Getenv("GRPC_COMPRESSOR") diff --git a/service/tier1.go b/service/tier1.go index c3d8c2f28..f402ef176 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -840,6 +840,8 @@ func (s *Tier1Service) blocks(ctx context.Context, cancelRunning context.CancelC return err } + logFields = append(logFields, zap.String("session_id", sessionID)) + s.logger.Debug("acquired session", zap.String("session_id", sessionID)) // Pass sessionKey through context for WorkerPool @@ -850,7 +852,6 @@ func (s *Tier1Service) blocks(ctx context.Context, cancelRunning context.CancelC s.sessionPool.Release(sessionID) }() } - traceID := tracing.GetTraceID(ctx).String() if s.activeRequestsManager != nil { From dd2022e0e0fad83f700b1303d0d505ea59b111ac Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 13:09:47 -0500 Subject: [PATCH 33/47] Refactor error handling in Tier1 services and expand `connect.Error` to gRPC status mappings --- reqctx/request.go | 1 + service/error.go | 25 ++++++++++++++++++++++++- service/service_connect.go | 2 +- service/service_grpc.go | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/reqctx/request.go b/reqctx/request.go index f0ab7bffb..064193642 100644 --- a/reqctx/request.go +++ b/reqctx/request.go @@ -42,6 +42,7 @@ func (d *RequestDetails) AssertProcessedBlocksLimit(requiredBlocksStore, require if requiredBlocksStore+requiredBlocksRange > d.LimitProcessedBlocks { return fmt.Errorf("request needs to process a total of %d blocks (including %d to prepare the stores) but only %d blocks are allowed according to the 'limit-processed-blocks' request argument", requiredBlocksStore+requiredBlocksRange, requiredBlocksStore, d.LimitProcessedBlocks) } + return fmt.Errorf("request needs to process a total of %d blocks (including %d to prepare the stores) but only %d blocks are allowed according to the 'limit-processed-blocks' request argument", requiredBlocksStore+requiredBlocksRange, requiredBlocksStore, d.LimitProcessedBlocks) return nil } diff --git a/service/error.go b/service/error.go index 1fcb00887..f4d1d8b20 100644 --- a/service/error.go +++ b/service/error.go @@ -126,7 +126,8 @@ func toGrpcTier1Error(ctx context.Context, err error) error { // convert connectWeb error connectError := new(connect.Error) if errors.As(err, &connectError) { - switch connectError.Code() { + code := connectError.Code() + switch code { case connect.CodeCanceled: return status.Error(codes.Canceled, connectError.Message()) case connect.CodeUnavailable: @@ -137,6 +138,28 @@ func toGrpcTier1Error(ctx context.Context, err error) error { return status.Error(codes.DeadlineExceeded, connectError.Message()) case connect.CodeResourceExhausted: return status.Error(codes.ResourceExhausted, connectError.Message()) + case connect.CodeFailedPrecondition: + return status.Error(codes.FailedPrecondition, connectError.Message()) + case connect.CodeAborted: + return status.Error(codes.Aborted, connectError.Message()) + case connect.CodeOutOfRange: + return status.Error(codes.OutOfRange, connectError.Message()) + case connect.CodeUnimplemented: + return status.Error(codes.Unimplemented, connectError.Message()) + case connect.CodeInternal: + return status.Error(codes.Internal, connectError.Message()) + case connect.CodeUnknown: + return status.Error(codes.Unknown, connectError.Message()) + case connect.CodeNotFound: + return status.Error(codes.NotFound, connectError.Message()) + case connect.CodeAlreadyExists: + return status.Error(codes.AlreadyExists, connectError.Message()) + case connect.CodePermissionDenied: + return status.Error(codes.PermissionDenied, connectError.Message()) + case connect.CodeUnauthenticated: + return status.Error(codes.Unauthenticated, connectError.Message()) + case connect.CodeDataLoss: + return status.Error(codes.DataLoss, connectError.Message()) default: return status.Error(codes.Unknown, connectError.Message()) } diff --git a/service/service_connect.go b/service/service_connect.go index 4f003c46e..af45dbe09 100644 --- a/service/service_connect.go +++ b/service/service_connect.go @@ -95,7 +95,7 @@ func (s *Tier1Service) BlocksAnyConnect( return err } - if connectError := toConnectError(runningCtx, err); connectError != nil { + if connectError := toConnectError(runningCtx, blockErr); connectError != nil { switch connect.CodeOf(connectError) { case connect.CodeInternal: logger.Warn("unexpected termination of stream of blocks", zap.String("stream_processor", "tier1"), zap.Error(err)) diff --git a/service/service_grpc.go b/service/service_grpc.go index ac81a5351..0c3611b0f 100644 --- a/service/service_grpc.go +++ b/service/service_grpc.go @@ -53,7 +53,7 @@ func (s *Tier1Service) BlocksAnyGrpc( return err } - if grpcErr := toGrpcTier1Error(runningCtx, err); grpcErr != nil { + if grpcErr := toGrpcTier1Error(runningCtx, blockErr); grpcErr != nil { switch status.Code(grpcErr) { case codes.Internal: logger.Warn("unexpected termination of stream of blocks", zap.String("stream_processor", "tier1"), zap.Error(err)) From b3e6967aa8d300f0f5c0d3fcb5e50196cbd182a8 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 13:58:43 -0500 Subject: [PATCH 34/47] Make `maxDataSize` configurable via `MESSAGE_BUFFER_MAX_DATA_SIZE` environment variable and update `MessageBuffer` flushing logic --- orchestrator/execout/message_buffer.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 76d725759..25e28e460 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -2,6 +2,8 @@ package execout import ( "fmt" + "os" + "strconv" "sync" "time" @@ -17,12 +19,26 @@ type MessageBuffer struct { maxBufferedMessage int DataSize int logger *zap.Logger + maxDataSize int } func NewMessageBuffer(maxBufferedMessage int, logger *zap.Logger) *MessageBuffer { + maxDaraSize := 1024 * 1024 * 10 + maxDataSizeString := os.Getenv("MESSAGE_BUFFER_MAX_DATA_SIZE") + + if maxDataSizeString != "" { + parsed, err := strconv.Atoi(maxDataSizeString) + if err != nil { + logger.Warn("failed to parse MESSAGE_BUFFER_MAX_DATA_SIZE, using default value", zap.Error(err)) + } else { + maxDaraSize = parsed + } + } + return &MessageBuffer{ buf: &pbsubstreamsrpcv2.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}}, maxBufferedMessage: maxBufferedMessage, + maxDataSize: maxDaraSize, logger: logger.Named("message-buffer"), } } @@ -46,7 +62,7 @@ func (b *MessageBuffer) ShouldFlush() bool { b.mut.Lock() defer b.mut.Unlock() - if b.DataSize > 1024*1024*10 { + if b.DataSize > b.maxDataSize { b.logger.Debug("flushing due to large data size", zap.Int("data_size", b.DataSize), zap.Bool("keep", false)) return true } From 82a73c8c5c9624a9e93c6dba9d4a26dc38485b60 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Thu, 12 Feb 2026 14:38:52 -0500 Subject: [PATCH 35/47] Remove duplicate error return in `validateRequest` function of `reqctx/request.go` --- reqctx/request.go | 1 - 1 file changed, 1 deletion(-) diff --git a/reqctx/request.go b/reqctx/request.go index 064193642..f0ab7bffb 100644 --- a/reqctx/request.go +++ b/reqctx/request.go @@ -42,7 +42,6 @@ func (d *RequestDetails) AssertProcessedBlocksLimit(requiredBlocksStore, require if requiredBlocksStore+requiredBlocksRange > d.LimitProcessedBlocks { return fmt.Errorf("request needs to process a total of %d blocks (including %d to prepare the stores) but only %d blocks are allowed according to the 'limit-processed-blocks' request argument", requiredBlocksStore+requiredBlocksRange, requiredBlocksStore, d.LimitProcessedBlocks) } - return fmt.Errorf("request needs to process a total of %d blocks (including %d to prepare the stores) but only %d blocks are allowed according to the 'limit-processed-blocks' request argument", requiredBlocksStore+requiredBlocksRange, requiredBlocksStore, d.LimitProcessedBlocks) return nil } From ad02b567ba99f38f7d6fd5f667440140f9bbf137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Fri, 13 Feb 2026 10:27:58 -0500 Subject: [PATCH 36/47] bump dgrpc to move GRPCSizeLogging there --- client/client.go | 115 +++++++++++------------------------------------ go.mod | 2 +- go.sum | 4 +- 3 files changed, 28 insertions(+), 93 deletions(-) diff --git a/client/client.go b/client/client.go index 616ab487a..8509cd30a 100644 --- a/client/client.go +++ b/client/client.go @@ -1,7 +1,6 @@ package client import ( - "context" "crypto/tls" "fmt" "log" @@ -9,13 +8,10 @@ import ( "os" "regexp" "strconv" - "time" - "github.com/dustin/go-humanize" "github.com/mostynb/go-grpc-compression/experimental/s2" "github.com/streamingfast/dgrpc" networks "github.com/streamingfast/firehose-networks" - "github.com/streamingfast/logging/zapx" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" "github.com/streamingfast/substreams/protodecode" "go.uber.org/zap" @@ -28,7 +24,6 @@ import ( xdscreds "google.golang.org/grpc/credentials/xds" "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/encoding/gzip" - stats "google.golang.org/grpc/stats" _ "google.golang.org/grpc/xds" ) @@ -174,71 +169,6 @@ func (c *SubstreamsClientConfig) MarshalLogObject(encoder zapcore.ObjectEncoder) return nil } -type sizeLoggingHandler struct { - messageLimit int - messageCount int - timeStart time.Time - - uncompressedBytes int - compressedBytes int - wireBytes int - lastReceivedTime time.Time - waitToReceive time.Duration -} - -func (h *sizeLoggingHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { - zlog.Info("gRPC client RPC started", zap.String("method", info.FullMethodName)) - return ctx -} - -func (h *sizeLoggingHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { - //fmt.Println("handle rpc:", h.messageCount) - if inPayload, ok := rs.(*stats.InPayload); ok && inPayload != nil { - if h.messageCount == 0 { - h.timeStart = time.Now() - } - h.waitToReceive += time.Since(h.lastReceivedTime) - h.lastReceivedTime = time.Now() - h.messageCount++ - h.uncompressedBytes += inPayload.Length - h.compressedBytes += inPayload.CompressedLength - h.wireBytes += inPayload.WireLength - - if h.messageCount == h.messageLimit { - secs := time.Since(h.timeStart).Seconds() - messagesPerSecond := float64(h.messageCount) / secs - compressedPercentage := 100.0 - (float64(h.compressedBytes) / float64(h.uncompressedBytes) * 100.0) - - zlog.Info( - "grpc io stats", - zap.Float64("msg_sec", messagesPerSecond), - zapx.HumanDuration("duration", time.Since(h.timeStart)), - zapx.HumanDuration("wait_to_receive", h.waitToReceive), - zap.String("compression_ratio", fmt.Sprintf("%.2f%%", compressedPercentage)), - zap.String("uncompressed", humanize.Bytes(uint64(h.uncompressedBytes))), - zap.String("compressed", humanize.Bytes(uint64(h.compressedBytes))), - zap.Int("uncompressed_bytes", h.uncompressedBytes), - zap.Int("compressed_bytes", h.compressedBytes), - zap.Bool("keep", false), - ) - - h.timeStart = time.Now() - h.messageCount = 0 - h.uncompressedBytes = 0 - h.compressedBytes = 0 - h.wireBytes = 0 - h.waitToReceive = 0 - } - } -} - -func (h *sizeLoggingHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context { - return ctx -} - -func (h *sizeLoggingHandler) HandleConn(ctx context.Context, cs stats.ConnStats) { -} - type InternalClientFactory = func() (cli pbssinternal.SubstreamsClient, closeFunc func() error, callOpts []grpc.CallOption, headers Headers, err error) // NewSubstreamsClientConfig creates a new SubstreamsClientConfig using the provided options. @@ -365,8 +295,10 @@ func NewSubstreamsInternalClient(config *SubstreamsClientConfig) (cli pbssintern } } - sizeHandler := &sizeLoggingHandler{} - dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) + if messageLimit, ok := getGRPCSizeLoggerFromEnv(); ok { + sizeHandler := dgrpc.NewSizeLoggingHandler(messageLimit, zlog) + dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) + } zlog.Debug("getting connection", zap.String("endpoint", endpoint)) conn, err := dgrpc.NewExternalClientConn(endpoint, dialOptions...) @@ -434,27 +366,13 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close dialOptions = []grpc.DialOption{grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{InsecureSkipVerify: true}))} } } - messageLimitString := os.Getenv("GRPC_SIZE_LOGGER_MESSAGE_LIMIT") - messageLimit := 10000 - if messageLimitString != "" { - messageLimit, err = strconv.Atoi(messageLimitString) - if err != nil { - return nil, nil, nil, nil, fmt.Errorf("failed to parse GRPC_SIZE_LOGGER_MESSAGE_LIMIT: %w", err) - } - } - sizeHandler := &sizeLoggingHandler{ - messageLimit: messageLimit, + + if messageLimit, ok := getGRPCSizeLoggerFromEnv(); ok { + sizeHandler := dgrpc.NewSizeLoggingHandler(messageLimit, zlog) + dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) } - dialOptions = append(dialOptions, grpc.WithStatsHandler(sizeHandler)) - //compressor := os.Getenv("GRPC_COMPRESSOR") - //switch compressor { - //case "gzip": - //dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) - //case "s2": dialOptions = append(dialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(s2.Name))) - //} - dialOptions = append(dialOptions, grpc.WithUserAgent(config.agent)) zlog.Debug("getting connection", zap.String("endpoint", endpoint)) @@ -482,3 +400,20 @@ func newConnection(config *SubstreamsClientConfig) (conn *grpc.ClientConn, close func NewSubstreamsClientConn(config *SubstreamsClientConfig) (conn *grpc.ClientConn, closeFunc func() error, callOpts []grpc.CallOption, headers Headers, err error) { return newConnection(config) } + +func getGRPCSizeLoggerFromEnv() (limit int, ok bool) { + messageLimitString := os.Getenv("GRPC_SIZE_LOGGER_MESSAGE_LIMIT") + if messageLimitString == "" { + return 0, false + } + messageLimit := 10000 + var err error + if messageLimitString != "" { + messageLimit, err = strconv.Atoi(messageLimitString) + if err != nil { + zlog.Warn("failed to parse GRPC_SIZE_LOGGER_MESSAGE_LIMIT", zap.Error(err)) + return 0, false + } + } + return messageLimit, true +} diff --git a/go.mod b/go.mod index 5ea5788ad..58f7f90f4 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd + github.com/streamingfast/dgrpc v0.0.0-20260213152215-f3029d261635 github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 diff --git a/go.sum b/go.sum index 18dcec036..d6bc58a00 100644 --- a/go.sum +++ b/go.sum @@ -559,8 +559,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd h1:LRu2q7HnzkU/G+K3/m1VrXDszUS8G47v9qAuDI56BXQ= -github.com/streamingfast/dgrpc v0.0.0-20260211171202-db61f19b4ebd/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= +github.com/streamingfast/dgrpc v0.0.0-20260213152215-f3029d261635 h1:Li0CmLrYB1PAM8HoFZZtPMGR31vlSUeMZLuowIXR+BU= +github.com/streamingfast/dgrpc v0.0.0-20260213152215-f3029d261635/go.mod h1:S6lJ9Dd6M3myzWbxspuhGggHtld9uYVN0xQ/7EGXmX8= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= From fe8cd88ad537563207b4716d4bdb270abcea80ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Fri, 13 Feb 2026 11:37:22 -0500 Subject: [PATCH 37/47] bump dgrpc, use grpc/connectweb server objects directly --- go.mod | 2 +- go.sum | 4 +-- go.work.sum | 2 ++ service/server.go | 82 +++++++++++++++++++++++------------------------ 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/go.mod b/go.mod index 58f7f90f4..fbaa535a1 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260213152215-f3029d261635 + github.com/streamingfast/dgrpc v0.0.0-20260213162824-8daf6d0a5775 github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 diff --git a/go.sum b/go.sum index d6bc58a00..82ddf76b2 100644 --- a/go.sum +++ b/go.sum @@ -559,8 +559,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20260213152215-f3029d261635 h1:Li0CmLrYB1PAM8HoFZZtPMGR31vlSUeMZLuowIXR+BU= -github.com/streamingfast/dgrpc v0.0.0-20260213152215-f3029d261635/go.mod h1:S6lJ9Dd6M3myzWbxspuhGggHtld9uYVN0xQ/7EGXmX8= +github.com/streamingfast/dgrpc v0.0.0-20260213162824-8daf6d0a5775 h1:tYX0K+6n5Jjl8wxczjUANVsmrIYv9E2yz6ERCRDmOeo= +github.com/streamingfast/dgrpc v0.0.0-20260213162824-8daf6d0a5775/go.mod h1:S6lJ9Dd6M3myzWbxspuhGggHtld9uYVN0xQ/7EGXmX8= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= diff --git a/go.work.sum b/go.work.sum index 2905e0cbb..03a400991 100644 --- a/go.work.sum +++ b/go.work.sum @@ -995,6 +995,8 @@ github.com/streamingfast/dgrpc v0.0.0-20250227145723-9bc2e4941b4e/go.mod h1:qdcs github.com/streamingfast/dgrpc v0.0.0-20251218133127-15b36e02a74f/go.mod h1:B+RAf6/idk6Kz41wEAEeQH1PW3Bk6WQkmvuRhdTEgKg= github.com/streamingfast/dgrpc v0.0.0-20260211152336-d4e7023003dd h1:w/K/23PASRF0jXPDcbjuboA/Q+AGVlikmdqLfHW4fSo= github.com/streamingfast/dgrpc v0.0.0-20260211152336-d4e7023003dd/go.mod h1:NQH6mtw4wGmYanNywYMbmTZcMbvJCVYX/7pFwiiGinI= +github.com/streamingfast/dgrpc v0.0.0-20260213162222-42220be8df77 h1:pte6v/VflXXo5DQ6o7FYyQ32mtxnEPO4bQK4he0umx8= +github.com/streamingfast/dgrpc v0.0.0-20260213162222-42220be8df77/go.mod h1:S6lJ9Dd6M3myzWbxspuhGggHtld9uYVN0xQ/7EGXmX8= github.com/streamingfast/dhammer v0.0.0-20230125192823-c34bbd561bd4/go.mod h1:ehPytv7E4rI65iLcrwTes4rNGGqPPiugnH+20nDQyp4= github.com/streamingfast/dmetrics v0.0.0-20210811180524-8494aeb34447/go.mod h1:VLdQY/FwczmC/flqWkcsBbqXO4BhU4zQDSK7GMrpcjY= github.com/streamingfast/dmetrics v0.0.0-20250711072030-f023e918a175/go.mod h1:JbxEDbzWRG1dHdNIPrYfuPllEkktZMgm40AwVIBENcw= diff --git a/service/server.go b/service/server.go index f470f1aaf..01c4533cc 100644 --- a/service/server.go +++ b/service/server.go @@ -18,6 +18,7 @@ import ( dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" dgrpcserver "github.com/streamingfast/dgrpc/server" + "github.com/streamingfast/dgrpc/server/connectrpc" connectweb "github.com/streamingfast/dgrpc/server/connectrpc" "github.com/streamingfast/dgrpc/server/factory" "github.com/streamingfast/dgrpc/server/standard" @@ -166,12 +167,22 @@ func grpcServer( healthcheck dgrpcserver.HealthCheck, enforceCompression bool, logger *zap.Logger, -) dgrpcserver.Server { - options := GetCommonServerOptions(logger, healthcheck, enforceCompression) - options = append(options, dgrpcserver.WithPostUnaryInterceptor(dauthgrpc.UnaryAuthChecker(auth, logger))) - options = append(options, dgrpcserver.WithPostStreamInterceptor(dauthgrpc.StreamAuthChecker(auth, logger))) +) *standard.StandardServer { + options := &dgrpcserver.Options{ + Logger: logger, + HealthCheck: healthcheck, + HealthCheckOver: dgrpcserver.HealthCheckOverGRPC | dgrpcserver.HealthCheckOverHTTP, + ServerOptions: []grpc.ServerOption{ + grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(otel.GetTracerProvider()))), + grpc.MaxRecvMsgSize(1024 * 1024 * 1024), + }, + EnforceCompression: enforceCompression, + PostUnaryInterceptors: []grpc.UnaryServerInterceptor{dauthgrpc.UnaryAuthChecker(auth, logger)}, + PostStreamInterceptors: []grpc.StreamServerInterceptor{dauthgrpc.StreamAuthChecker(auth, logger)}, + } + + server := standard.NewServer(options) - server := factory.ServerFromOptions(options...) pbsubstreamsrpc.RegisterStreamServer(server.ServiceRegistrar(), service) pbsubstreamsrpcv3.RegisterStreamServer(server.ServiceRegistrar(), &v3Adapter{service}) if infoService != nil { @@ -179,7 +190,6 @@ func grpcServer( } return server - } func connectServer( @@ -189,17 +199,23 @@ func connectServer( healthcheck dgrpcserver.HealthCheck, enforceCompression bool, logger *zap.Logger, -) dgrpcserver.Server { - options := GetConnectCommonServerOptions(logger, healthcheck, enforceCompression) +) *connectrpc.ConnectWebServer { + tracerProvider := otel.GetTracerProvider() + options := []dgrpcserver.Option{ + dgrpcserver.WithLogger(logger), + dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), + dgrpcserver.WithGRPCServerOptions( + grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), + grpc.MaxRecvMsgSize(1024*1024*1024), + ), + } options = append(options, dgrpcserver.WithConnectInterceptor(dauthconnect.NewAuthInterceptor(auth, logger))) options = append(options, dgrpcserver.WithConnectStrictContentType(false)) options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv2connect.StreamName)) options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) - //todo: move compression to dgrpc :-( - streamHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { var o []connect.HandlerOption for _, opt := range opts { @@ -253,7 +269,20 @@ func ListenTier2( healthcheck dgrpcserver.HealthCheck, enforceCompression bool, ) (err error) { - options := GetCommonServerOptions(logger, healthcheck, enforceCompression) + tracerProvider := otel.GetTracerProvider() + options := []dgrpcserver.Option{ + + dgrpcserver.WithLogger(logger), + dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), + dgrpcserver.WithGRPCServerOptions( + grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), + grpc.MaxRecvMsgSize(1024*1024*1024), + ), + } + if enforceCompression { + options = append(options, dgrpcserver.WithEnforceCompression()) + } + if serviceDiscoveryURL != nil { options = append(options, dgrpcserver.WithServiceDiscoveryURL(serviceDiscoveryURL)) } @@ -287,34 +316,3 @@ func ListenTier2( return } - -func GetCommonServerOptions(logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { - tracerProvider := otel.GetTracerProvider() - options := []dgrpcserver.Option{ - - dgrpcserver.WithLogger(logger), - dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), - dgrpcserver.WithGRPCServerOptions( - grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), - grpc.MaxRecvMsgSize(1024*1024*1024), - ), - } - if enforceCompression { - options = append(options, dgrpcserver.WithEnforceCompression()) - } - - return options -} - -func GetConnectCommonServerOptions(logger *zap.Logger, healthcheck dgrpcserver.HealthCheck, enforceCompression bool) []dgrpcserver.Option { - tracerProvider := otel.GetTracerProvider() - options := []dgrpcserver.Option{ - dgrpcserver.WithLogger(logger), - dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), - dgrpcserver.WithGRPCServerOptions( - grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), - grpc.MaxRecvMsgSize(1024*1024*1024), - ), - } - return options -} From 5d6c7f358d1dad1d07d63754f4135ddce3e5a135 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Fri, 13 Feb 2026 13:07:12 -0500 Subject: [PATCH 38/47] Introduce v4 RPC API for `BlockScopedDatas` and refactor dependent services and structures # Conflicts: # service/server.go --- client/client.go | 15 +- orchestrator/execout/execout_walker.go | 52 +-- orchestrator/execout/message_buffer.go | 27 +- orchestrator/parallelprocessor.go | 2 + orchestrator/response/stream.go | 3 +- pb/sf/substreams/rpc/v2/service.pb.go | 287 +++++++--------- pb/sf/substreams/rpc/v2/service_vtproto.pb.go | 308 ------------------ pipeline/pipeline.go | 4 + proto/sf/substreams/rpc/v2/service.proto | 5 - proto/sf/substreams/rpc/v4/service.proto | 46 +++ service/server.go | 123 ------- service/service_connect.go | 170 +++++++++- service/service_grpc.go | 63 +++- service/testing.go | 2 +- service/tier1.go | 91 ++++-- service/tier2.go | 1 + sink/sinker.go | 119 +++++-- types.go | 7 +- 18 files changed, 617 insertions(+), 708 deletions(-) create mode 100644 proto/sf/substreams/rpc/v4/service.proto diff --git a/client/client.go b/client/client.go index 8509cd30a..6f5d271d5 100644 --- a/client/client.go +++ b/client/client.go @@ -45,6 +45,7 @@ const ( ProtocolVersionUnset ProtocolVersion = 0 ProtocolVersionV2 ProtocolVersion = 2 ProtocolVersionV3 ProtocolVersion = 3 + ProtocolVersionV4 ProtocolVersion = 4 ) // String returns the string representation of the protocol version @@ -56,6 +57,8 @@ func (pv ProtocolVersion) String() string { return "v2" case ProtocolVersionV3: return "v3" + case ProtocolVersionV4: + return "v4" default: return "unknown" } @@ -63,7 +66,7 @@ func (pv ProtocolVersion) String() string { // IsValid returns true if the protocol version is valid func (pv ProtocolVersion) IsValid() bool { - return pv == ProtocolVersionUnset || pv == ProtocolVersionV2 || pv == ProtocolVersionV3 + return pv == ProtocolVersionUnset || pv == ProtocolVersionV2 || pv == ProtocolVersionV3 || pv == ProtocolVersionV4 } // ParseProtocolVersion parses an integer to a ProtocolVersion @@ -75,8 +78,10 @@ func ParseProtocolVersion(version int) (ProtocolVersion, error) { return ProtocolVersionV2, nil case 3: return ProtocolVersionV3, nil + case 4: + return ProtocolVersionV4, nil default: - return ProtocolVersionUnset, fmt.Errorf("invalid protocol version %d, only 0, 2 and 3 are supported", version) + return ProtocolVersionUnset, fmt.Errorf("invalid protocol version %d, only 0, 2, 3 and 4 are supported", version) } } @@ -88,6 +93,10 @@ func (pv ProtocolVersion) IsV3() bool { return pv == ProtocolVersionV3 } +func (pv ProtocolVersion) IsV4() bool { + return pv == ProtocolVersionV4 +} + func (pv ProtocolVersion) IsUnset() bool { return pv == ProtocolVersionUnset } @@ -106,7 +115,7 @@ type SubstreamsClientConfigOptions struct { PlainText bool // Agent is the User-Agent string for gRPC requests Agent string - // ForceProtocolVersion forces the use of a specific protocol version (2 or 3) + // ForceProtocolVersion forces the use of a specific protocol version (2, 3 or 4) ForceProtocolVersion ProtocolVersion } diff --git a/orchestrator/execout/execout_walker.go b/orchestrator/execout/execout_walker.go index e84e1a265..6eaf9889c 100644 --- a/orchestrator/execout/execout_walker.go +++ b/orchestrator/execout/execout_walker.go @@ -25,14 +25,15 @@ import ( type Walker struct { ctx context.Context *block.Range - fileWalker *execout.FileWalker - streamOut *response.Stream - module *pbsubstreams.Module - logger *zap.Logger - working bool - workingAt time.Time // Timestamp when working was set to true - noopMode bool - buffer *MessageBuffer + fileWalker *execout.FileWalker + streamOut *response.Stream + module *pbsubstreams.Module + logger *zap.Logger + working bool + workingAt time.Time // Timestamp when working was set to true + noopMode bool + buffer *MessageBuffer + supportBuffering bool } func NewWalker( @@ -43,17 +44,19 @@ func NewWalker( stream *response.Stream, noopMode bool, bufferSize int, + supportBuffering bool, ) *Walker { logger := reqctx.Logger(ctx).Named("execout_walker") return &Walker{ - ctx: ctx, - module: module, - fileWalker: fileWalker, - Range: walkRange, - streamOut: stream, - noopMode: noopMode, - logger: logger, - buffer: NewMessageBuffer(bufferSize, logger), + ctx: ctx, + module: module, + fileWalker: fileWalker, + Range: walkRange, + streamOut: stream, + noopMode: noopMode, + logger: logger, + buffer: NewMessageBuffer(bufferSize, supportBuffering, logger), + supportBuffering: supportBuffering, } } @@ -229,7 +232,7 @@ func (r *Walker) sendItems(reader execout.FileReader) error { itemCount := 0 for item, err := range reader.Iter() { if err != nil { - if err == io.EOF { + if err == io.EOF && r.supportBuffering { err := r.buffer.Flush(r.streamOut) if err != nil { return fmt.Errorf("flushing buffer on eof: %w", err) @@ -254,11 +257,18 @@ func (r *Walker) sendItems(reader execout.FileReader) error { return fmt.Errorf("converting to block scoped data: %w", err) } - r.buffer.Append(blockScopedData, len(item.Payload)) - if r.buffer.ShouldFlush() { - err := r.buffer.Flush(r.streamOut) + if r.supportBuffering { + r.buffer.Append(blockScopedData, len(item.Payload)) + if r.buffer.ShouldFlush() { + err := r.buffer.Flush(r.streamOut) + if err != nil { + return fmt.Errorf("flushing buffer: %w", err) + } + } + } else { + err := r.streamOut.BlockScopedData(blockScopedData) if err != nil { - return fmt.Errorf("flushing buffer: %w", err) + return fmt.Errorf("sending block scoped data: %w", err) } } itemCount++ diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 25e28e460..4d19e5933 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -9,20 +9,22 @@ import ( "github.com/streamingfast/substreams/orchestrator/response" pbsubstreamsrpcv2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" "go.uber.org/zap" ) type MessageBuffer struct { mut sync.RWMutex - buf *pbsubstreamsrpcv2.BlockScopedDatas + buf *pbsubstreamsrpcv4.BlockScopedDatas lastFlush time.Time maxBufferedMessage int DataSize int logger *zap.Logger maxDataSize int + supportBuffer bool } -func NewMessageBuffer(maxBufferedMessage int, logger *zap.Logger) *MessageBuffer { +func NewMessageBuffer(maxBufferedMessage int, supportBuffer bool, logger *zap.Logger) *MessageBuffer { maxDaraSize := 1024 * 1024 * 10 maxDataSizeString := os.Getenv("MESSAGE_BUFFER_MAX_DATA_SIZE") @@ -36,9 +38,10 @@ func NewMessageBuffer(maxBufferedMessage int, logger *zap.Logger) *MessageBuffer } return &MessageBuffer{ - buf: &pbsubstreamsrpcv2.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}}, + buf: &pbsubstreamsrpcv4.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}}, maxBufferedMessage: maxBufferedMessage, maxDataSize: maxDaraSize, + supportBuffer: supportBuffer, logger: logger.Named("message-buffer"), } } @@ -80,9 +83,19 @@ func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { if b.maxBufferedMessage < 2 { for _, msg := range b.buf.Items { - err := streamSrv.BlockScopedData(msg) - if err != nil { - return fmt.Errorf("flushing single block scope data: %w", err) + if b.supportBuffer { //this is looking weird but if a v4 request is running the support of BlockScopedData has been removed + d := &pbsubstreamsrpcv4.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{ + msg, + }} + err := streamSrv.BlockScopedDatas(d) + if err != nil { + return fmt.Errorf("flushing buffer: %w", err) + } + } else { + err := streamSrv.BlockScopedData(msg) + if err != nil { + return fmt.Errorf("flushing single block scope data: %w", err) + } } } } else { @@ -94,7 +107,7 @@ func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { b.lastFlush = time.Now() b.DataSize = 0 - b.buf = &pbsubstreamsrpcv2.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}} + b.buf = &pbsubstreamsrpcv4.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}} return nil } diff --git a/orchestrator/parallelprocessor.go b/orchestrator/parallelprocessor.go index 9f1f27c68..005abac94 100644 --- a/orchestrator/parallelprocessor.go +++ b/orchestrator/parallelprocessor.go @@ -34,6 +34,7 @@ func BuildParallelProcessor( storeConfigs store.ConfigMap, noopMode bool, bufferSize int, + supportBuffering bool, ) (*ParallelProcessor, error) { // FIXME: Are all the progress messages properly sent? When we skip some stores and mark them complete, @@ -70,6 +71,7 @@ func BuildParallelProcessor( stream, noopMode, bufferSize, + supportBuffering, ) } } diff --git a/orchestrator/response/stream.go b/orchestrator/response/stream.go index 187b18e46..94cc8e577 100644 --- a/orchestrator/response/stream.go +++ b/orchestrator/response/stream.go @@ -3,6 +3,7 @@ package response import ( "github.com/streamingfast/substreams" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" ) type Stream struct { @@ -19,7 +20,7 @@ func (s *Stream) BlockScopedData(in *pbsubstreamsrpc.BlockScopedData) error { return s.respFunc(substreams.NewBlockScopedDataResponse(in)) } -func (s *Stream) BlockScopedDatas(in *pbsubstreamsrpc.BlockScopedDatas) error { +func (s *Stream) BlockScopedDatas(in *pbsubstreamsrpcv4.BlockScopedDatas) error { return s.respFunc(substreams.NewBlockScopedDatasResponse(in)) } diff --git a/pb/sf/substreams/rpc/v2/service.pb.go b/pb/sf/substreams/rpc/v2/service.pb.go index 6412a8bde..ed8980918 100644 --- a/pb/sf/substreams/rpc/v2/service.pb.go +++ b/pb/sf/substreams/rpc/v2/service.pb.go @@ -73,7 +73,7 @@ func (x StoreDelta_Operation) Number() protoreflect.EnumNumber { // Deprecated: Use StoreDelta_Operation.Descriptor instead. func (StoreDelta_Operation) EnumDescriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{18, 0} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{17, 0} } type Request struct { @@ -257,7 +257,6 @@ type Response struct { // *Response_BlockScopedData // *Response_BlockUndoSignal // *Response_FatalError - // *Response_BlockScopedDatas // *Response_DebugSnapshotData // *Response_DebugSnapshotComplete Message isResponse_Message `protobuf_oneof:"message"` @@ -347,15 +346,6 @@ func (x *Response) GetFatalError() *Error { return nil } -func (x *Response) GetBlockScopedDatas() *BlockScopedDatas { - if x != nil { - if x, ok := x.Message.(*Response_BlockScopedDatas); ok { - return x.BlockScopedDatas - } - } - return nil -} - func (x *Response) GetDebugSnapshotData() *InitialSnapshotData { if x != nil { if x, ok := x.Message.(*Response_DebugSnapshotData); ok { @@ -398,10 +388,6 @@ type Response_FatalError struct { FatalError *Error `protobuf:"bytes,5,opt,name=fatal_error,json=fatalError,proto3,oneof"` } -type Response_BlockScopedDatas struct { - BlockScopedDatas *BlockScopedDatas `protobuf:"bytes,6,opt,name=block_scoped_datas,json=blockScopedDatas,proto3,oneof"` -} - type Response_DebugSnapshotData struct { // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. DebugSnapshotData *InitialSnapshotData `protobuf:"bytes,10,opt,name=debug_snapshot_data,json=debugSnapshotData,proto3,oneof"` @@ -422,8 +408,6 @@ func (*Response_BlockUndoSignal) isResponse_Message() {} func (*Response_FatalError) isResponse_Message() {} -func (*Response_BlockScopedDatas) isResponse_Message() {} - func (*Response_DebugSnapshotData) isResponse_Message() {} func (*Response_DebugSnapshotComplete) isResponse_Message() {} @@ -483,50 +467,6 @@ func (x *BlockUndoSignal) GetLastValidCursor() string { return "" } -type BlockScopedDatas struct { - state protoimpl.MessageState `protogen:"open.v1"` - Items []*BlockScopedData `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BlockScopedDatas) Reset() { - *x = BlockScopedDatas{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BlockScopedDatas) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockScopedDatas) ProtoMessage() {} - -func (x *BlockScopedDatas) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlockScopedDatas.ProtoReflect.Descriptor instead. -func (*BlockScopedDatas) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{3} -} - -func (x *BlockScopedDatas) GetItems() []*BlockScopedData { - if x != nil { - return x.Items - } - return nil -} - type BlockScopedData struct { state protoimpl.MessageState `protogen:"open.v1"` Output *MapModuleOutput `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` @@ -552,7 +492,7 @@ type BlockScopedData struct { func (x *BlockScopedData) Reset() { *x = BlockScopedData{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -564,7 +504,7 @@ func (x *BlockScopedData) String() string { func (*BlockScopedData) ProtoMessage() {} func (x *BlockScopedData) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -577,7 +517,7 @@ func (x *BlockScopedData) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockScopedData.ProtoReflect.Descriptor instead. func (*BlockScopedData) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{4} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{3} } func (x *BlockScopedData) GetOutput() *MapModuleOutput { @@ -676,7 +616,7 @@ type SessionInit struct { func (x *SessionInit) Reset() { *x = SessionInit{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -688,7 +628,7 @@ func (x *SessionInit) String() string { func (*SessionInit) ProtoMessage() {} func (x *SessionInit) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -701,7 +641,7 @@ func (x *SessionInit) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionInit.ProtoReflect.Descriptor instead. func (*SessionInit) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{5} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{4} } func (x *SessionInit) GetTraceId() string { @@ -783,7 +723,7 @@ type InitialSnapshotComplete struct { func (x *InitialSnapshotComplete) Reset() { *x = InitialSnapshotComplete{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -795,7 +735,7 @@ func (x *InitialSnapshotComplete) String() string { func (*InitialSnapshotComplete) ProtoMessage() {} func (x *InitialSnapshotComplete) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -808,7 +748,7 @@ func (x *InitialSnapshotComplete) ProtoReflect() protoreflect.Message { // Deprecated: Use InitialSnapshotComplete.ProtoReflect.Descriptor instead. func (*InitialSnapshotComplete) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{6} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{5} } func (x *InitialSnapshotComplete) GetCursor() string { @@ -830,7 +770,7 @@ type InitialSnapshotData struct { func (x *InitialSnapshotData) Reset() { *x = InitialSnapshotData{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -842,7 +782,7 @@ func (x *InitialSnapshotData) String() string { func (*InitialSnapshotData) ProtoMessage() {} func (x *InitialSnapshotData) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -855,7 +795,7 @@ func (x *InitialSnapshotData) ProtoReflect() protoreflect.Message { // Deprecated: Use InitialSnapshotData.ProtoReflect.Descriptor instead. func (*InitialSnapshotData) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{7} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{6} } func (x *InitialSnapshotData) GetModuleName() string { @@ -898,7 +838,7 @@ type MapModuleOutput struct { func (x *MapModuleOutput) Reset() { *x = MapModuleOutput{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -910,7 +850,7 @@ func (x *MapModuleOutput) String() string { func (*MapModuleOutput) ProtoMessage() {} func (x *MapModuleOutput) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -923,7 +863,7 @@ func (x *MapModuleOutput) ProtoReflect() protoreflect.Message { // Deprecated: Use MapModuleOutput.ProtoReflect.Descriptor instead. func (*MapModuleOutput) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{8} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{7} } func (x *MapModuleOutput) GetName() string { @@ -962,7 +902,7 @@ type StoreModuleOutput struct { func (x *StoreModuleOutput) Reset() { *x = StoreModuleOutput{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -974,7 +914,7 @@ func (x *StoreModuleOutput) String() string { func (*StoreModuleOutput) ProtoMessage() {} func (x *StoreModuleOutput) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -987,7 +927,7 @@ func (x *StoreModuleOutput) ProtoReflect() protoreflect.Message { // Deprecated: Use StoreModuleOutput.ProtoReflect.Descriptor instead. func (*StoreModuleOutput) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{9} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{8} } func (x *StoreModuleOutput) GetName() string { @@ -1024,7 +964,7 @@ type OutputDebugInfo struct { func (x *OutputDebugInfo) Reset() { *x = OutputDebugInfo{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1036,7 +976,7 @@ func (x *OutputDebugInfo) String() string { func (*OutputDebugInfo) ProtoMessage() {} func (x *OutputDebugInfo) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1049,7 +989,7 @@ func (x *OutputDebugInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use OutputDebugInfo.ProtoReflect.Descriptor instead. func (*OutputDebugInfo) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{10} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{9} } func (x *OutputDebugInfo) GetLogs() []string { @@ -1090,7 +1030,7 @@ type ModulesProgress struct { func (x *ModulesProgress) Reset() { *x = ModulesProgress{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1102,7 +1042,7 @@ func (x *ModulesProgress) String() string { func (*ModulesProgress) ProtoMessage() {} func (x *ModulesProgress) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1115,7 +1055,7 @@ func (x *ModulesProgress) ProtoReflect() protoreflect.Message { // Deprecated: Use ModulesProgress.ProtoReflect.Descriptor instead. func (*ModulesProgress) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{11} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{10} } func (x *ModulesProgress) GetRunningJobs() []*Job { @@ -1163,7 +1103,7 @@ type ProcessedBytes struct { func (x *ProcessedBytes) Reset() { *x = ProcessedBytes{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1175,7 +1115,7 @@ func (x *ProcessedBytes) String() string { func (*ProcessedBytes) ProtoMessage() {} func (x *ProcessedBytes) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1188,7 +1128,7 @@ func (x *ProcessedBytes) ProtoReflect() protoreflect.Message { // Deprecated: Use ProcessedBytes.ProtoReflect.Descriptor instead. func (*ProcessedBytes) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{12} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{11} } func (x *ProcessedBytes) GetTotalBytesRead() uint64 { @@ -1219,7 +1159,7 @@ type Error struct { func (x *Error) Reset() { *x = Error{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1231,7 +1171,7 @@ func (x *Error) String() string { func (*Error) ProtoMessage() {} func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1244,7 +1184,7 @@ func (x *Error) ProtoReflect() protoreflect.Message { // Deprecated: Use Error.ProtoReflect.Descriptor instead. func (*Error) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{13} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{12} } func (x *Error) GetModule() string { @@ -1288,7 +1228,7 @@ type Job struct { func (x *Job) Reset() { *x = Job{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1300,7 +1240,7 @@ func (x *Job) String() string { func (*Job) ProtoMessage() {} func (x *Job) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1313,7 +1253,7 @@ func (x *Job) ProtoReflect() protoreflect.Message { // Deprecated: Use Job.ProtoReflect.Descriptor instead. func (*Job) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{14} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{13} } func (x *Job) GetStage() uint32 { @@ -1361,7 +1301,7 @@ type Stage struct { func (x *Stage) Reset() { *x = Stage{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1373,7 +1313,7 @@ func (x *Stage) String() string { func (*Stage) ProtoMessage() {} func (x *Stage) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1386,7 +1326,7 @@ func (x *Stage) ProtoReflect() protoreflect.Message { // Deprecated: Use Stage.ProtoReflect.Descriptor instead. func (*Stage) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{15} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{14} } func (x *Stage) GetModules() []string { @@ -1438,7 +1378,7 @@ type ModuleStats struct { func (x *ModuleStats) Reset() { *x = ModuleStats{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1450,7 +1390,7 @@ func (x *ModuleStats) String() string { func (*ModuleStats) ProtoMessage() {} func (x *ModuleStats) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1463,7 +1403,7 @@ func (x *ModuleStats) ProtoReflect() protoreflect.Message { // Deprecated: Use ModuleStats.ProtoReflect.Descriptor instead. func (*ModuleStats) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{16} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{15} } func (x *ModuleStats) GetName() string { @@ -1561,7 +1501,7 @@ type ExternalCallMetric struct { func (x *ExternalCallMetric) Reset() { *x = ExternalCallMetric{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1573,7 +1513,7 @@ func (x *ExternalCallMetric) String() string { func (*ExternalCallMetric) ProtoMessage() {} func (x *ExternalCallMetric) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1586,7 +1526,7 @@ func (x *ExternalCallMetric) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalCallMetric.ProtoReflect.Descriptor instead. func (*ExternalCallMetric) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{17} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{16} } func (x *ExternalCallMetric) GetName() string { @@ -1623,7 +1563,7 @@ type StoreDelta struct { func (x *StoreDelta) Reset() { *x = StoreDelta{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1635,7 +1575,7 @@ func (x *StoreDelta) String() string { func (*StoreDelta) ProtoMessage() {} func (x *StoreDelta) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1648,7 +1588,7 @@ func (x *StoreDelta) ProtoReflect() protoreflect.Message { // Deprecated: Use StoreDelta.ProtoReflect.Descriptor instead. func (*StoreDelta) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{18} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{17} } func (x *StoreDelta) GetOperation() StoreDelta_Operation { @@ -1696,7 +1636,7 @@ type BlockRange struct { func (x *BlockRange) Reset() { *x = BlockRange{} - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[19] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1708,7 +1648,7 @@ func (x *BlockRange) String() string { func (*BlockRange) ProtoMessage() {} func (x *BlockRange) ProtoReflect() protoreflect.Message { - mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[19] + mi := &file_sf_substreams_rpc_v2_service_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1721,7 +1661,7 @@ func (x *BlockRange) ProtoReflect() protoreflect.Message { // Deprecated: Use BlockRange.ProtoReflect.Descriptor instead. func (*BlockRange) Descriptor() ([]byte, []int) { - return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{19} + return file_sf_substreams_rpc_v2_service_proto_rawDescGZIP(), []int{18} } func (x *BlockRange) GetStartBlock() uint64 { @@ -1757,24 +1697,21 @@ const file_sf_substreams_rpc_v2_service_proto_rawDesc = "" + "\x16limit_processed_blocks\x18\f \x01(\x04R\x14limitProcessedBlocks\x12,\n" + "\x12dev_output_modules\x18\r \x03(\tR\x10devOutputModules\x12A\n" + "\x1dprogress_messages_interval_ms\x18\x0e \x01(\x04R\x1aprogressMessagesIntervalMs\x12%\n" + - "\x0epartial_blocks\x18\x10 \x01(\bR\rpartialBlocksJ\x04\b\x0f\x10\x10\"\xa1\x05\n" + + "\x0epartial_blocks\x18\x10 \x01(\bR\rpartialBlocksJ\x04\b\x0f\x10\x10\"\xc9\x04\n" + "\bResponse\x12=\n" + "\asession\x18\x01 \x01(\v2!.sf.substreams.rpc.v2.SessionInitH\x00R\asession\x12C\n" + "\bprogress\x18\x02 \x01(\v2%.sf.substreams.rpc.v2.ModulesProgressH\x00R\bprogress\x12S\n" + "\x11block_scoped_data\x18\x03 \x01(\v2%.sf.substreams.rpc.v2.BlockScopedDataH\x00R\x0fblockScopedData\x12S\n" + "\x11block_undo_signal\x18\x04 \x01(\v2%.sf.substreams.rpc.v2.BlockUndoSignalH\x00R\x0fblockUndoSignal\x12>\n" + "\vfatal_error\x18\x05 \x01(\v2\x1b.sf.substreams.rpc.v2.ErrorH\x00R\n" + - "fatalError\x12V\n" + - "\x12block_scoped_datas\x18\x06 \x01(\v2&.sf.substreams.rpc.v2.BlockScopedDatasH\x00R\x10blockScopedDatas\x12[\n" + + "fatalError\x12[\n" + "\x13debug_snapshot_data\x18\n" + " \x01(\v2).sf.substreams.rpc.v2.InitialSnapshotDataH\x00R\x11debugSnapshotData\x12g\n" + "\x17debug_snapshot_complete\x18\v \x01(\v2-.sf.substreams.rpc.v2.InitialSnapshotCompleteH\x00R\x15debugSnapshotCompleteB\t\n" + "\amessage\"\x83\x01\n" + "\x0fBlockUndoSignal\x12D\n" + "\x10last_valid_block\x18\x01 \x01(\v2\x1a.sf.substreams.v1.BlockRefR\x0elastValidBlock\x12*\n" + - "\x11last_valid_cursor\x18\x02 \x01(\tR\x0flastValidCursor\"O\n" + - "\x10BlockScopedDatas\x12;\n" + - "\x05items\x18\x01 \x03(\v2%.sf.substreams.rpc.v2.BlockScopedDataR\x05items\"\xaf\x04\n" + + "\x11last_valid_cursor\x18\x02 \x01(\tR\x0flastValidCursor\"\xaf\x04\n" + "\x0fBlockScopedData\x12=\n" + "\x06output\x18\x01 \x01(\v2%.sf.substreams.rpc.v2.MapModuleOutputR\x06output\x12-\n" + "\x05clock\x18\x02 \x01(\v2\x17.sf.substreams.v1.ClockR\x05clock\x12\x16\n" + @@ -1911,73 +1848,70 @@ func file_sf_substreams_rpc_v2_service_proto_rawDescGZIP() []byte { } var file_sf_substreams_rpc_v2_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_sf_substreams_rpc_v2_service_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_sf_substreams_rpc_v2_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_sf_substreams_rpc_v2_service_proto_goTypes = []any{ (StoreDelta_Operation)(0), // 0: sf.substreams.rpc.v2.StoreDelta.Operation (*Request)(nil), // 1: sf.substreams.rpc.v2.Request (*Response)(nil), // 2: sf.substreams.rpc.v2.Response (*BlockUndoSignal)(nil), // 3: sf.substreams.rpc.v2.BlockUndoSignal - (*BlockScopedDatas)(nil), // 4: sf.substreams.rpc.v2.BlockScopedDatas - (*BlockScopedData)(nil), // 5: sf.substreams.rpc.v2.BlockScopedData - (*SessionInit)(nil), // 6: sf.substreams.rpc.v2.SessionInit - (*InitialSnapshotComplete)(nil), // 7: sf.substreams.rpc.v2.InitialSnapshotComplete - (*InitialSnapshotData)(nil), // 8: sf.substreams.rpc.v2.InitialSnapshotData - (*MapModuleOutput)(nil), // 9: sf.substreams.rpc.v2.MapModuleOutput - (*StoreModuleOutput)(nil), // 10: sf.substreams.rpc.v2.StoreModuleOutput - (*OutputDebugInfo)(nil), // 11: sf.substreams.rpc.v2.OutputDebugInfo - (*ModulesProgress)(nil), // 12: sf.substreams.rpc.v2.ModulesProgress - (*ProcessedBytes)(nil), // 13: sf.substreams.rpc.v2.ProcessedBytes - (*Error)(nil), // 14: sf.substreams.rpc.v2.Error - (*Job)(nil), // 15: sf.substreams.rpc.v2.Job - (*Stage)(nil), // 16: sf.substreams.rpc.v2.Stage - (*ModuleStats)(nil), // 17: sf.substreams.rpc.v2.ModuleStats - (*ExternalCallMetric)(nil), // 18: sf.substreams.rpc.v2.ExternalCallMetric - (*StoreDelta)(nil), // 19: sf.substreams.rpc.v2.StoreDelta - (*BlockRange)(nil), // 20: sf.substreams.rpc.v2.BlockRange - (*v1.Modules)(nil), // 21: sf.substreams.v1.Modules - (*v1.BlockRef)(nil), // 22: sf.substreams.v1.BlockRef - (*v1.Clock)(nil), // 23: sf.substreams.v1.Clock - (*anypb.Any)(nil), // 24: google.protobuf.Any - (*v2.InfoRequest)(nil), // 25: sf.firehose.v2.InfoRequest - (*v2.InfoResponse)(nil), // 26: sf.firehose.v2.InfoResponse + (*BlockScopedData)(nil), // 4: sf.substreams.rpc.v2.BlockScopedData + (*SessionInit)(nil), // 5: sf.substreams.rpc.v2.SessionInit + (*InitialSnapshotComplete)(nil), // 6: sf.substreams.rpc.v2.InitialSnapshotComplete + (*InitialSnapshotData)(nil), // 7: sf.substreams.rpc.v2.InitialSnapshotData + (*MapModuleOutput)(nil), // 8: sf.substreams.rpc.v2.MapModuleOutput + (*StoreModuleOutput)(nil), // 9: sf.substreams.rpc.v2.StoreModuleOutput + (*OutputDebugInfo)(nil), // 10: sf.substreams.rpc.v2.OutputDebugInfo + (*ModulesProgress)(nil), // 11: sf.substreams.rpc.v2.ModulesProgress + (*ProcessedBytes)(nil), // 12: sf.substreams.rpc.v2.ProcessedBytes + (*Error)(nil), // 13: sf.substreams.rpc.v2.Error + (*Job)(nil), // 14: sf.substreams.rpc.v2.Job + (*Stage)(nil), // 15: sf.substreams.rpc.v2.Stage + (*ModuleStats)(nil), // 16: sf.substreams.rpc.v2.ModuleStats + (*ExternalCallMetric)(nil), // 17: sf.substreams.rpc.v2.ExternalCallMetric + (*StoreDelta)(nil), // 18: sf.substreams.rpc.v2.StoreDelta + (*BlockRange)(nil), // 19: sf.substreams.rpc.v2.BlockRange + (*v1.Modules)(nil), // 20: sf.substreams.v1.Modules + (*v1.BlockRef)(nil), // 21: sf.substreams.v1.BlockRef + (*v1.Clock)(nil), // 22: sf.substreams.v1.Clock + (*anypb.Any)(nil), // 23: google.protobuf.Any + (*v2.InfoRequest)(nil), // 24: sf.firehose.v2.InfoRequest + (*v2.InfoResponse)(nil), // 25: sf.firehose.v2.InfoResponse } var file_sf_substreams_rpc_v2_service_proto_depIdxs = []int32{ - 21, // 0: sf.substreams.rpc.v2.Request.modules:type_name -> sf.substreams.v1.Modules - 6, // 1: sf.substreams.rpc.v2.Response.session:type_name -> sf.substreams.rpc.v2.SessionInit - 12, // 2: sf.substreams.rpc.v2.Response.progress:type_name -> sf.substreams.rpc.v2.ModulesProgress - 5, // 3: sf.substreams.rpc.v2.Response.block_scoped_data:type_name -> sf.substreams.rpc.v2.BlockScopedData + 20, // 0: sf.substreams.rpc.v2.Request.modules:type_name -> sf.substreams.v1.Modules + 5, // 1: sf.substreams.rpc.v2.Response.session:type_name -> sf.substreams.rpc.v2.SessionInit + 11, // 2: sf.substreams.rpc.v2.Response.progress:type_name -> sf.substreams.rpc.v2.ModulesProgress + 4, // 3: sf.substreams.rpc.v2.Response.block_scoped_data:type_name -> sf.substreams.rpc.v2.BlockScopedData 3, // 4: sf.substreams.rpc.v2.Response.block_undo_signal:type_name -> sf.substreams.rpc.v2.BlockUndoSignal - 14, // 5: sf.substreams.rpc.v2.Response.fatal_error:type_name -> sf.substreams.rpc.v2.Error - 4, // 6: sf.substreams.rpc.v2.Response.block_scoped_datas:type_name -> sf.substreams.rpc.v2.BlockScopedDatas - 8, // 7: sf.substreams.rpc.v2.Response.debug_snapshot_data:type_name -> sf.substreams.rpc.v2.InitialSnapshotData - 7, // 8: sf.substreams.rpc.v2.Response.debug_snapshot_complete:type_name -> sf.substreams.rpc.v2.InitialSnapshotComplete - 22, // 9: sf.substreams.rpc.v2.BlockUndoSignal.last_valid_block:type_name -> sf.substreams.v1.BlockRef - 5, // 10: sf.substreams.rpc.v2.BlockScopedDatas.items:type_name -> sf.substreams.rpc.v2.BlockScopedData - 9, // 11: sf.substreams.rpc.v2.BlockScopedData.output:type_name -> sf.substreams.rpc.v2.MapModuleOutput - 23, // 12: sf.substreams.rpc.v2.BlockScopedData.clock:type_name -> sf.substreams.v1.Clock - 9, // 13: sf.substreams.rpc.v2.BlockScopedData.debug_map_outputs:type_name -> sf.substreams.rpc.v2.MapModuleOutput - 10, // 14: sf.substreams.rpc.v2.BlockScopedData.debug_store_outputs:type_name -> sf.substreams.rpc.v2.StoreModuleOutput - 19, // 15: sf.substreams.rpc.v2.InitialSnapshotData.deltas:type_name -> sf.substreams.rpc.v2.StoreDelta - 24, // 16: sf.substreams.rpc.v2.MapModuleOutput.map_output:type_name -> google.protobuf.Any - 11, // 17: sf.substreams.rpc.v2.MapModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo - 19, // 18: sf.substreams.rpc.v2.StoreModuleOutput.debug_store_deltas:type_name -> sf.substreams.rpc.v2.StoreDelta - 11, // 19: sf.substreams.rpc.v2.StoreModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo - 15, // 20: sf.substreams.rpc.v2.ModulesProgress.running_jobs:type_name -> sf.substreams.rpc.v2.Job - 17, // 21: sf.substreams.rpc.v2.ModulesProgress.modules_stats:type_name -> sf.substreams.rpc.v2.ModuleStats - 16, // 22: sf.substreams.rpc.v2.ModulesProgress.stages:type_name -> sf.substreams.rpc.v2.Stage - 13, // 23: sf.substreams.rpc.v2.ModulesProgress.processed_bytes:type_name -> sf.substreams.rpc.v2.ProcessedBytes - 20, // 24: sf.substreams.rpc.v2.Stage.completed_ranges:type_name -> sf.substreams.rpc.v2.BlockRange - 18, // 25: sf.substreams.rpc.v2.ModuleStats.external_call_metrics:type_name -> sf.substreams.rpc.v2.ExternalCallMetric - 0, // 26: sf.substreams.rpc.v2.StoreDelta.operation:type_name -> sf.substreams.rpc.v2.StoreDelta.Operation - 1, // 27: sf.substreams.rpc.v2.Stream.Blocks:input_type -> sf.substreams.rpc.v2.Request - 25, // 28: sf.substreams.rpc.v2.EndpointInfo.Info:input_type -> sf.firehose.v2.InfoRequest - 2, // 29: sf.substreams.rpc.v2.Stream.Blocks:output_type -> sf.substreams.rpc.v2.Response - 26, // 30: sf.substreams.rpc.v2.EndpointInfo.Info:output_type -> sf.firehose.v2.InfoResponse - 29, // [29:31] is the sub-list for method output_type - 27, // [27:29] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 13, // 5: sf.substreams.rpc.v2.Response.fatal_error:type_name -> sf.substreams.rpc.v2.Error + 7, // 6: sf.substreams.rpc.v2.Response.debug_snapshot_data:type_name -> sf.substreams.rpc.v2.InitialSnapshotData + 6, // 7: sf.substreams.rpc.v2.Response.debug_snapshot_complete:type_name -> sf.substreams.rpc.v2.InitialSnapshotComplete + 21, // 8: sf.substreams.rpc.v2.BlockUndoSignal.last_valid_block:type_name -> sf.substreams.v1.BlockRef + 8, // 9: sf.substreams.rpc.v2.BlockScopedData.output:type_name -> sf.substreams.rpc.v2.MapModuleOutput + 22, // 10: sf.substreams.rpc.v2.BlockScopedData.clock:type_name -> sf.substreams.v1.Clock + 8, // 11: sf.substreams.rpc.v2.BlockScopedData.debug_map_outputs:type_name -> sf.substreams.rpc.v2.MapModuleOutput + 9, // 12: sf.substreams.rpc.v2.BlockScopedData.debug_store_outputs:type_name -> sf.substreams.rpc.v2.StoreModuleOutput + 18, // 13: sf.substreams.rpc.v2.InitialSnapshotData.deltas:type_name -> sf.substreams.rpc.v2.StoreDelta + 23, // 14: sf.substreams.rpc.v2.MapModuleOutput.map_output:type_name -> google.protobuf.Any + 10, // 15: sf.substreams.rpc.v2.MapModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo + 18, // 16: sf.substreams.rpc.v2.StoreModuleOutput.debug_store_deltas:type_name -> sf.substreams.rpc.v2.StoreDelta + 10, // 17: sf.substreams.rpc.v2.StoreModuleOutput.debug_info:type_name -> sf.substreams.rpc.v2.OutputDebugInfo + 14, // 18: sf.substreams.rpc.v2.ModulesProgress.running_jobs:type_name -> sf.substreams.rpc.v2.Job + 16, // 19: sf.substreams.rpc.v2.ModulesProgress.modules_stats:type_name -> sf.substreams.rpc.v2.ModuleStats + 15, // 20: sf.substreams.rpc.v2.ModulesProgress.stages:type_name -> sf.substreams.rpc.v2.Stage + 12, // 21: sf.substreams.rpc.v2.ModulesProgress.processed_bytes:type_name -> sf.substreams.rpc.v2.ProcessedBytes + 19, // 22: sf.substreams.rpc.v2.Stage.completed_ranges:type_name -> sf.substreams.rpc.v2.BlockRange + 17, // 23: sf.substreams.rpc.v2.ModuleStats.external_call_metrics:type_name -> sf.substreams.rpc.v2.ExternalCallMetric + 0, // 24: sf.substreams.rpc.v2.StoreDelta.operation:type_name -> sf.substreams.rpc.v2.StoreDelta.Operation + 1, // 25: sf.substreams.rpc.v2.Stream.Blocks:input_type -> sf.substreams.rpc.v2.Request + 24, // 26: sf.substreams.rpc.v2.EndpointInfo.Info:input_type -> sf.firehose.v2.InfoRequest + 2, // 27: sf.substreams.rpc.v2.Stream.Blocks:output_type -> sf.substreams.rpc.v2.Response + 25, // 28: sf.substreams.rpc.v2.EndpointInfo.Info:output_type -> sf.firehose.v2.InfoResponse + 27, // [27:29] is the sub-list for method output_type + 25, // [25:27] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name } func init() { file_sf_substreams_rpc_v2_service_proto_init() } @@ -1991,18 +1925,17 @@ func file_sf_substreams_rpc_v2_service_proto_init() { (*Response_BlockScopedData)(nil), (*Response_BlockUndoSignal)(nil), (*Response_FatalError)(nil), - (*Response_BlockScopedDatas)(nil), (*Response_DebugSnapshotData)(nil), (*Response_DebugSnapshotComplete)(nil), } - file_sf_substreams_rpc_v2_service_proto_msgTypes[4].OneofWrappers = []any{} + file_sf_substreams_rpc_v2_service_proto_msgTypes[3].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_sf_substreams_rpc_v2_service_proto_rawDesc), len(file_sf_substreams_rpc_v2_service_proto_rawDesc)), NumEnums: 1, - NumMessages: 20, + NumMessages: 19, NumExtensions: 0, NumServices: 2, }, diff --git a/pb/sf/substreams/rpc/v2/service_vtproto.pb.go b/pb/sf/substreams/rpc/v2/service_vtproto.pb.go index 99f23f687..a1f287add 100644 --- a/pb/sf/substreams/rpc/v2/service_vtproto.pb.go +++ b/pb/sf/substreams/rpc/v2/service_vtproto.pb.go @@ -123,15 +123,6 @@ func (m *Response_FatalError) CloneVT() isResponse_Message { return r } -func (m *Response_BlockScopedDatas) CloneVT() isResponse_Message { - if m == nil { - return (*Response_BlockScopedDatas)(nil) - } - r := new(Response_BlockScopedDatas) - r.BlockScopedDatas = m.BlockScopedDatas.CloneVT() - return r -} - func (m *Response_DebugSnapshotData) CloneVT() isResponse_Message { if m == nil { return (*Response_DebugSnapshotData)(nil) @@ -168,29 +159,6 @@ func (m *BlockUndoSignal) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *BlockScopedDatas) CloneVT() *BlockScopedDatas { - if m == nil { - return (*BlockScopedDatas)(nil) - } - r := new(BlockScopedDatas) - if rhs := m.Items; rhs != nil { - tmpContainer := make([]*BlockScopedData, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } - r.Items = tmpContainer - } - if len(m.unknownFields) > 0 { - r.unknownFields = make([]byte, len(m.unknownFields)) - copy(r.unknownFields, m.unknownFields) - } - return r -} - -func (m *BlockScopedDatas) CloneMessageVT() proto.Message { - return m.CloneVT() -} - func (m *BlockScopedData) CloneVT() *BlockScopedData { if m == nil { return (*BlockScopedData)(nil) @@ -819,31 +787,6 @@ func (this *Response_FatalError) EqualVT(thatIface isResponse_Message) bool { return true } -func (this *Response_BlockScopedDatas) EqualVT(thatIface isResponse_Message) bool { - that, ok := thatIface.(*Response_BlockScopedDatas) - if !ok { - return false - } - if this == that { - return true - } - if this == nil && that != nil || this != nil && that == nil { - return false - } - if p, q := this.BlockScopedDatas, that.BlockScopedDatas; p != q { - if p == nil { - p = &BlockScopedDatas{} - } - if q == nil { - q = &BlockScopedDatas{} - } - if !p.EqualVT(q) { - return false - } - } - return true -} - func (this *Response_DebugSnapshotData) EqualVT(thatIface isResponse_Message) bool { that, ok := thatIface.(*Response_DebugSnapshotData) if !ok { @@ -916,39 +859,6 @@ func (this *BlockUndoSignal) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } -func (this *BlockScopedDatas) EqualVT(that *BlockScopedDatas) bool { - if this == that { - return true - } else if this == nil || that == nil { - return false - } - if len(this.Items) != len(that.Items) { - return false - } - for i, vx := range this.Items { - vy := that.Items[i] - if p, q := vx, vy; p != q { - if p == nil { - p = &BlockScopedData{} - } - if q == nil { - q = &BlockScopedData{} - } - if !p.EqualVT(q) { - return false - } - } - } - return string(this.unknownFields) == string(that.unknownFields) -} - -func (this *BlockScopedDatas) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*BlockScopedDatas) - if !ok { - return false - } - return this.EqualVT(that) -} func (this *BlockScopedData) EqualVT(that *BlockScopedData) bool { if this == that { return true @@ -1845,25 +1755,6 @@ func (m *Response_FatalError) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } -func (m *Response_BlockScopedDatas) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *Response_BlockScopedDatas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BlockScopedDatas != nil { - size, err := m.BlockScopedDatas.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} func (m *Response_DebugSnapshotData) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) @@ -1952,51 +1843,6 @@ func (m *BlockUndoSignal) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BlockScopedDatas) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockScopedDatas) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *BlockScopedDatas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Items[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *BlockScopedData) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -3191,18 +3037,6 @@ func (m *Response_FatalError) SizeVT() (n int) { } return n } -func (m *Response_BlockScopedDatas) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockScopedDatas != nil { - l = m.BlockScopedDatas.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - return n -} func (m *Response_DebugSnapshotData) SizeVT() (n int) { if m == nil { return 0 @@ -3245,22 +3079,6 @@ func (m *BlockUndoSignal) SizeVT() (n int) { return n } -func (m *BlockScopedDatas) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - } - n += len(m.unknownFields) - return n -} - func (m *BlockScopedData) SizeVT() (n int) { if m == nil { return 0 @@ -4305,47 +4123,6 @@ func (m *Response) UnmarshalVT(dAtA []byte) error { m.Message = &Response_FatalError{FatalError: v} } iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockScopedDatas", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if oneof, ok := m.Message.(*Response_BlockScopedDatas); ok { - if err := oneof.BlockScopedDatas.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - v := &BlockScopedDatas{} - if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Message = &Response_BlockScopedDatas{BlockScopedDatas: v} - } - iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DebugSnapshotData", wireType) @@ -4569,91 +4346,6 @@ func (m *BlockUndoSignal) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *BlockScopedDatas) UnmarshalVT(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 protohelpers.ErrIntOverflow - } - 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: BlockScopedDatas: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockScopedDatas: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, &BlockScopedData{}) - if err := m.Items[len(m.Items)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *BlockScopedData) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index 3e8f029b1..e1ab958ea 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -136,6 +136,7 @@ type Pipeline struct { workerPoolFactory work.WorkerPoolFactory checkPendingShutdown func() bool bufferSize int + supportBuffering bool } func New( @@ -155,6 +156,7 @@ func New( checkPendingShutdown func() bool, foundationalEndpoints map[string]string, bufferSize int, + supportBuffering bool, opts ...Option, ) *Pipeline { pipe := &Pipeline{ @@ -181,6 +183,7 @@ func New( checkPendingShutdown: checkPendingShutdown, moduleNameToStage: make(map[string]int), bufferSize: bufferSize, + supportBuffering: supportBuffering, } for _, opt := range opts { opt(pipe) @@ -509,6 +512,7 @@ func (p *Pipeline) runParallelProcess(ctx context.Context, reqPlan *plan.Request p.stores.configs, noopMode, p.bufferSize, + p.supportBuffering, ) if err != nil { return nil, fmt.Errorf("building parallel processor: %w", err) diff --git a/proto/sf/substreams/rpc/v2/service.proto b/proto/sf/substreams/rpc/v2/service.proto index ccecc9c47..fbaa383f2 100644 --- a/proto/sf/substreams/rpc/v2/service.proto +++ b/proto/sf/substreams/rpc/v2/service.proto @@ -85,7 +85,6 @@ message Response { BlockScopedData block_scoped_data = 3; BlockUndoSignal block_undo_signal = 4; Error fatal_error = 5; - BlockScopedDatas block_scoped_datas = 6; // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. InitialSnapshotData debug_snapshot_data = 10; @@ -104,10 +103,6 @@ message BlockUndoSignal { string last_valid_cursor = 2; } -message BlockScopedDatas { - repeated BlockScopedData items = 1; -} - message BlockScopedData { MapModuleOutput output = 1; sf.substreams.v1.Clock clock = 2; diff --git a/proto/sf/substreams/rpc/v4/service.proto b/proto/sf/substreams/rpc/v4/service.proto new file mode 100644 index 000000000..ab9a171b0 --- /dev/null +++ b/proto/sf/substreams/rpc/v4/service.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package sf.substreams.rpc.v4; + +import "google/protobuf/any.proto"; +import "sf/firehose/v2/firehose.proto"; +import "sf/substreams/rpc/v2/service.proto"; +import "sf/substreams/rpc/v3/service.proto"; +import "sf/substreams/v1/clock.proto"; +import "sf/substreams/v1/modules.proto"; +import "sf/substreams/v1/package.proto"; + +option go_package = "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4;pbsubstreamsrpcv4"; + +service Stream { + // Request processing of blocks via substreams engine. + // Similar to `sf.substreams.rpc.v2.Stream/Blocks` request, but: + // - the full spkg package is sent instead of just the modules + // - 'params' and 'network' fields are sent to apply the user-defined params to the package server-side + // Responses are identical to those of the v2 request. + rpc Blocks(sf.substreams.rpc.v3.Request) returns (stream Response); +} + + +message Response { + oneof message { + sf.substreams.rpc.v2.SessionInit session = 1; // Always sent first + sf.substreams.rpc.v2.ModulesProgress progress = 2; // Progress of data preparation, before sending in the stream of `data` events. + + BlockScopedDatas block_scoped_datas = 3; + sf.substreams.rpc.v2.BlockUndoSignal block_undo_signal = 4; + sf.substreams.rpc.v2.Error fatal_error = 5; + + // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. + sf.substreams.rpc.v2.InitialSnapshotData debug_snapshot_data = 10; + // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. + sf.substreams.rpc.v2.InitialSnapshotComplete debug_snapshot_complete = 11; + + // previously used in partial alpha tests = 12; + } +} + +message BlockScopedDatas { + repeated sf.substreams.rpc.v2.BlockScopedData items = 1; +} + diff --git a/service/server.go b/service/server.go index 01c4533cc..456e7e304 100644 --- a/service/server.go +++ b/service/server.go @@ -1,32 +1,23 @@ package service import ( - "context" "net" "net/http" "net/url" "strings" - "time" - "connectrpc.com/connect" - compress "github.com/klauspost/connect-compress/v2" _ "github.com/mostynb/go-grpc-compression/experimental/s2" _ "github.com/mostynb/go-grpc-compression/lz4" _ "github.com/mostynb/go-grpc-compression/zstd" _ "github.com/planetscale/vtprotobuf/codec/grpc" "github.com/streamingfast/dauth" - dauthconnect "github.com/streamingfast/dauth/middleware/connect" dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" dgrpcserver "github.com/streamingfast/dgrpc/server" - "github.com/streamingfast/dgrpc/server/connectrpc" - connectweb "github.com/streamingfast/dgrpc/server/connectrpc" "github.com/streamingfast/dgrpc/server/factory" "github.com/streamingfast/dgrpc/server/standard" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" - pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" - "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" "github.com/streamingfast/substreams/protodecode" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" @@ -42,20 +33,6 @@ func init() { encoding.RegisterCodec(protodecode.PreferredVTCodec{}) } -type streamHandlerV3 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error - -func (h streamHandlerV3) Blocks(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error { - return h(ctx, req, stream) -} - -type v3Adapter struct { - *Tier1Service -} - -func (a *v3Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3.Stream_BlocksServer) error { - return a.BlocksV3(req, srv) -} - func ListenTier1( listenAddresses []string, svc *Tier1Service, @@ -160,106 +137,6 @@ func ListenTier1( return } -func grpcServer( - service *Tier1Service, - infoService pbsubstreamsrpc.EndpointInfoServer, - auth dauth.Authenticator, - healthcheck dgrpcserver.HealthCheck, - enforceCompression bool, - logger *zap.Logger, -) *standard.StandardServer { - options := &dgrpcserver.Options{ - Logger: logger, - HealthCheck: healthcheck, - HealthCheckOver: dgrpcserver.HealthCheckOverGRPC | dgrpcserver.HealthCheckOverHTTP, - ServerOptions: []grpc.ServerOption{ - grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(otel.GetTracerProvider()))), - grpc.MaxRecvMsgSize(1024 * 1024 * 1024), - }, - EnforceCompression: enforceCompression, - PostUnaryInterceptors: []grpc.UnaryServerInterceptor{dauthgrpc.UnaryAuthChecker(auth, logger)}, - PostStreamInterceptors: []grpc.StreamServerInterceptor{dauthgrpc.StreamAuthChecker(auth, logger)}, - } - - server := standard.NewServer(options) - - pbsubstreamsrpc.RegisterStreamServer(server.ServiceRegistrar(), service) - pbsubstreamsrpcv3.RegisterStreamServer(server.ServiceRegistrar(), &v3Adapter{service}) - if infoService != nil { - pbsubstreamsrpc.RegisterEndpointInfoServer(server.ServiceRegistrar(), infoService) - } - - return server -} - -func connectServer( - service *ConnectService, - infoService pbsubstreamsrpcv2connect.EndpointInfoHandler, - auth dauth.Authenticator, - healthcheck dgrpcserver.HealthCheck, - enforceCompression bool, - logger *zap.Logger, -) *connectrpc.ConnectWebServer { - - tracerProvider := otel.GetTracerProvider() - options := []dgrpcserver.Option{ - dgrpcserver.WithLogger(logger), - dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), - dgrpcserver.WithGRPCServerOptions( - grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), - grpc.MaxRecvMsgSize(1024*1024*1024), - ), - } - options = append(options, dgrpcserver.WithConnectInterceptor(dauthconnect.NewAuthInterceptor(auth, logger))) - options = append(options, dgrpcserver.WithConnectStrictContentType(false)) - options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv2connect.StreamName)) - options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) - options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) - - streamHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { - var o []connect.HandlerOption - for _, opt := range opts { - o = append(o, opt) - } - o = append(o, compress.WithAll(compress.LevelBalanced)) - return pbsubstreamsrpcv2connect.NewStreamHandler(service, o...) - } - - streamHandlerGetterV3 := func(opts ...connect.HandlerOption) (string, http.Handler) { - handler := streamHandlerV3(service.BlocksV3) - var o []connect.HandlerOption - for _, opt := range opts { - o = append(o, opt) - } - o = append(o, compress.WithAll(compress.LevelBalanced)) - return pbsubstreamsrpcv3connect.NewStreamHandler(handler, o...) - } - - handlerGetters := []connectweb.HandlerGetter{streamHandlerGetter, streamHandlerGetterV3} - - if infoService != nil { - infoHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { - - var o []connect.HandlerOption - for _, opt := range opts { - o = append(o, opt) - } - o = append(o, compress.WithAll(compress.LevelBalanced)) - out, outh := pbsubstreamsrpcv2connect.NewEndpointInfoHandler(infoService, o...) - return out, outh - } - handlerGetters = append(handlerGetters, infoHandlerGetter) - } - - options = append(options, dgrpcserver.WithConnectPermissiveCORS()) - server := connectweb.New(handlerGetters, options...) - server.OnTerminating(func(err error) { - logger.Info("Tier1Service is terminating") - server.Shutdown(time.Duration(0)) - }) - return server -} - func ListenTier2( addr string, serviceDiscoveryURL *url.URL, diff --git a/service/service_connect.go b/service/service_connect.go index af45dbe09..e43c82d64 100644 --- a/service/service_connect.go +++ b/service/service_connect.go @@ -4,19 +4,135 @@ import ( "context" "fmt" "net/http" + "time" "connectrpc.com/connect" + compress "github.com/klauspost/connect-compress/v2" + "github.com/streamingfast/dauth" + dauthconnect "github.com/streamingfast/dauth/middleware/connect" + dgrpcserver "github.com/streamingfast/dgrpc/server" + "github.com/streamingfast/dgrpc/server/connectrpc" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2/pbsubstreamsrpcv2connect" pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3/pbsubstreamsrpcv3connect" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" + "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4/pbsubstreamsrpcv4connect" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "github.com/streamingfast/substreams/reqctx" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.opentelemetry.io/otel" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) +func connectServer( + service *ConnectService, + infoService pbsubstreamsrpcv2connect.EndpointInfoHandler, + auth dauth.Authenticator, + healthcheck dgrpcserver.HealthCheck, + enforceCompression bool, + logger *zap.Logger, +) *connectrpc.ConnectWebServer { + + tracerProvider := otel.GetTracerProvider() + options := []dgrpcserver.Option{ + dgrpcserver.WithLogger(logger), + dgrpcserver.WithHealthCheck(dgrpcserver.HealthCheckOverGRPC|dgrpcserver.HealthCheckOverHTTP, healthcheck), + dgrpcserver.WithGRPCServerOptions( + grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(tracerProvider))), + grpc.MaxRecvMsgSize(1024*1024*1024), + ), + } + options = append(options, dgrpcserver.WithConnectInterceptor(dauthconnect.NewAuthInterceptor(auth, logger))) + options = append(options, dgrpcserver.WithConnectStrictContentType(false)) + options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv2connect.StreamName)) + options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv3connect.StreamName)) + options = append(options, dgrpcserver.WithConnectReflection(pbsubstreamsrpcv4connect.StreamName)) + + streamHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { + var o []connect.HandlerOption + for _, opt := range opts { + o = append(o, opt) + } + o = append(o, compress.WithAll(compress.LevelBalanced)) + return pbsubstreamsrpcv2connect.NewStreamHandler(service, o...) + } + + streamHandlerGetterV3 := func(opts ...connect.HandlerOption) (string, http.Handler) { + handler := streamHandlerV3(service.BlocksV3) + var o []connect.HandlerOption + for _, opt := range opts { + o = append(o, opt) + } + o = append(o, compress.WithAll(compress.LevelBalanced)) + return pbsubstreamsrpcv3connect.NewStreamHandler(handler, o...) + } + + streamHandlerGetterV4 := func(opts ...connect.HandlerOption) (string, http.Handler) { + handler := streamHandlerV4(service.BlocksV4) + var o []connect.HandlerOption + for _, opt := range opts { + o = append(o, opt) + } + o = append(o, compress.WithAll(compress.LevelBalanced)) + return pbsubstreamsrpcv4connect.NewStreamHandler(handler, o...) + } + + handlerGetters := []connectrpc.HandlerGetter{streamHandlerGetter, streamHandlerGetterV3, streamHandlerGetterV4} + + if infoService != nil { + infoHandlerGetter := func(opts ...connect.HandlerOption) (string, http.Handler) { + + var o []connect.HandlerOption + for _, opt := range opts { + o = append(o, opt) + } + o = append(o, compress.WithAll(compress.LevelBalanced)) + out, outh := pbsubstreamsrpcv2connect.NewEndpointInfoHandler(infoService, o...) + return out, outh + } + handlerGetters = append(handlerGetters, infoHandlerGetter) + } + + options = append(options, dgrpcserver.WithConnectPermissiveCORS()) + server := connectrpc.New(handlerGetters, options...) + server.OnTerminating(func(err error) { + logger.Info("Tier1Service is terminating") + server.Shutdown(time.Duration(0)) + }) + return server +} + +type streamHandlerV3 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error + +func (h streamHandlerV3) Blocks(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response]) error { + return h(ctx, req, stream) +} + +type v3Adapter struct { + *Tier1Service +} + +func (a *v3Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3.Stream_BlocksServer) error { + return a.BlocksV3(req, srv) +} + +type streamHandlerV4 func(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpcv4.Response]) error + +func (h streamHandlerV4) Blocks(ctx context.Context, req *connect.Request[pbsubstreamsrpcv3.Request], stream *connect.ServerStream[pbsubstreamsrpcv4.Response]) error { + return h(ctx, req, stream) +} + +type v4Adapter struct { + *Tier1Service +} + +func (a *v4Adapter) Blocks(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv4.Stream_BlocksServer) error { + return a.BlocksV4(req, srv) +} + type ConnectService struct { inner *Tier1Service } @@ -30,7 +146,7 @@ func (s *ConnectService) Blocks( req *connect.Request[pbsubstreamsrpc.Request], stream *connect.ServerStream[pbsubstreamsrpc.Response], ) error { - return s.inner.BlocksAnyConnect(ctx, req.Msg, req.Header(), pbsubstreamsrpcv2connect.StreamBlocksProcedure, nil, &serverStreamWrapper{stream, ctx}) + return s.inner.BlocksAnyConnect(ctx, req.Msg, req.Header(), pbsubstreamsrpcv2connect.StreamBlocksProcedure, nil, &serverStreamWrapper{stream, ctx}, false) } func (s *ConnectService) BlocksV3( @@ -49,7 +165,26 @@ func (s *ConnectService) BlocksV3( return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("failed to convert request to v2: %w", err)) } - return s.inner.BlocksAnyConnect(ctx, v2req, req.Header(), pbsubstreamsrpcv3connect.StreamBlocksProcedure, req.Msg.Package, &serverStreamWrapper{stream, ctx}) + return s.inner.BlocksAnyConnect(ctx, v2req, req.Header(), pbsubstreamsrpcv3connect.StreamBlocksProcedure, req.Msg.Package, &serverStreamWrapper{stream, ctx}, false) +} + +func (s *ConnectService) BlocksV4( + ctx context.Context, + req *connect.Request[pbsubstreamsrpcv3.Request], + stream *connect.ServerStream[pbsubstreamsrpcv4.Response], +) error { + if req.Msg.Package == nil { + return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("package is required")) + } + + ctx = reqctx.WithSpkg(ctx, req.Msg.Package) + + v2req, err := req.Msg.ToV2() + if err != nil { + return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("failed to convert request to v2: %w", err)) + } + + return s.inner.BlocksAnyConnect(ctx, v2req, req.Header(), pbsubstreamsrpcv3connect.StreamBlocksProcedure, req.Msg.Package, &serverStreamWrapperV4{stream, ctx}, true) } type serverStreamWrapper struct { @@ -80,6 +215,34 @@ func (w *serverStreamWrapper) RecvMsg(m interface{}) error { return fmt.Errorf("not implemented") } +type serverStreamWrapperV4 struct { + *connect.ServerStream[pbsubstreamsrpcv4.Response] + ctx context.Context +} + +func (w *serverStreamWrapperV4) SetHeader(metadata.MD) error { + return nil +} + +func (w *serverStreamWrapperV4) SendHeader(metadata.MD) error { + return nil +} + +func (w *serverStreamWrapperV4) SetTrailer(metadata.MD) { +} + +func (w *serverStreamWrapperV4) Context() context.Context { + return w.ctx +} + +func (w *serverStreamWrapperV4) SendMsg(m interface{}) error { + return w.ServerStream.Send(m.(*pbsubstreamsrpcv4.Response)) +} + +func (w *serverStreamWrapperV4) RecvMsg(m interface{}) error { + return fmt.Errorf("not implemented") +} + func (s *Tier1Service) BlocksAnyConnect( ctx context.Context, request *pbsubstreamsrpc.Request, @@ -87,10 +250,11 @@ func (s *Tier1Service) BlocksAnyConnect( protocol string, pkg *pbsubstreams.Package, stream grpc.ServerStream, + supportBuffering bool, ) (serverErr error) { logger := reqctx.Logger(ctx).Named("tier1-connect") - runningCtx, err, blockErr := s.BlocksAny(ctx, request, header, protocol, pkg, stream, logger) + runningCtx, err, blockErr := s.BlocksAny(ctx, request, header, protocol, pkg, stream, supportBuffering, logger) if err != nil { return err } diff --git a/service/service_grpc.go b/service/service_grpc.go index 0c3611b0f..ba86c9182 100644 --- a/service/service_grpc.go +++ b/service/service_grpc.go @@ -4,22 +4,62 @@ import ( "context" "net/http" + "github.com/streamingfast/dauth" + dauthgrpc "github.com/streamingfast/dauth/middleware/grpc" + dgrpcserver "github.com/streamingfast/dgrpc/server" + "github.com/streamingfast/dgrpc/server/standard" "github.com/streamingfast/substreams/manifest" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "github.com/streamingfast/substreams/reqctx" + "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.opentelemetry.io/otel" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) +func grpcServer( + service *Tier1Service, + infoService pbsubstreamsrpc.EndpointInfoServer, + auth dauth.Authenticator, + healthcheck dgrpcserver.HealthCheck, + enforceCompression bool, + logger *zap.Logger, +) *standard.StandardServer { + options := &dgrpcserver.Options{ + Logger: logger, + HealthCheck: healthcheck, + HealthCheckOver: dgrpcserver.HealthCheckOverGRPC | dgrpcserver.HealthCheckOverHTTP, + ServerOptions: []grpc.ServerOption{ + grpc.StatsHandler(otelgrpc.NewServerHandler(otelgrpc.WithTracerProvider(otel.GetTracerProvider()))), + grpc.MaxRecvMsgSize(1024 * 1024 * 1024), + }, + EnforceCompression: enforceCompression, + PostUnaryInterceptors: []grpc.UnaryServerInterceptor{dauthgrpc.UnaryAuthChecker(auth, logger)}, + PostStreamInterceptors: []grpc.StreamServerInterceptor{dauthgrpc.StreamAuthChecker(auth, logger)}, + } + + server := standard.NewServer(options) + + pbsubstreamsrpc.RegisterStreamServer(server.ServiceRegistrar(), service) + pbsubstreamsrpcv3.RegisterStreamServer(server.ServiceRegistrar(), &v3Adapter{service}) + pbsubstreamsrpcv4.RegisterStreamServer(server.ServiceRegistrar(), &v4Adapter{service}) + if infoService != nil { + pbsubstreamsrpc.RegisterEndpointInfoServer(server.ServiceRegistrar(), infoService) + } + + return server +} + func (s *Tier1Service) Blocks(req *pbsubstreamsrpc.Request, srv pbsubstreamsrpc.Stream_BlocksServer) error { ctx := srv.Context() header := metadataToHeader(ctx) protocol := "/sf.substreams.rpc.v2.Stream/Blocks" - return s.BlocksAnyGrpc(ctx, req, header, protocol, nil, srv) + return s.BlocksAnyGrpc(ctx, req, header, protocol, nil, srv, false) } func (s *Tier1Service) BlocksV3(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv3.Stream_BlocksServer) error { @@ -35,7 +75,23 @@ func (s *Tier1Service) BlocksV3(req *pbsubstreamsrpcv3.Request, srv pbsubstreams } header := metadataToHeader(ctx) protocol := "/sf.substreams.rpc.v3.Stream/Blocks" - return s.BlocksAnyGrpc(ctx, v2req, header, protocol, req.Package, srv) + return s.BlocksAnyGrpc(ctx, v2req, header, protocol, req.Package, srv, false) +} + +func (s *Tier1Service) BlocksV4(req *pbsubstreamsrpcv3.Request, srv pbsubstreamsrpcv4.Stream_BlocksServer) error { + _, err := manifest.ApplyPackageTransformations(req.Package, false, req.Network, req.OutputModule, req.Params) + if err != nil { + return status.Errorf(codes.InvalidArgument, "%v", err) + } + ctx := srv.Context() + ctx = reqctx.WithSpkg(ctx, req.Package) + v2req, err := req.ToV2() + if err != nil { + return status.Errorf(codes.InvalidArgument, "failed to convert request to v2: %s", err) + } + header := metadataToHeader(ctx) + protocol := "/sf.substreams.rpc.v3.Stream/Blocks" + return s.BlocksAnyGrpc(ctx, v2req, header, protocol, req.Package, srv, true) } func (s *Tier1Service) BlocksAnyGrpc( @@ -45,10 +101,11 @@ func (s *Tier1Service) BlocksAnyGrpc( protocol string, pkg *pbsubstreams.Package, stream grpc.ServerStream, + supportBuffering bool, ) (serverErr error) { logger := reqctx.Logger(ctx).Named("tier1-grpc") - runningCtx, err, blockErr := s.BlocksAny(ctx, request, header, protocol, pkg, stream, logger) + runningCtx, err, blockErr := s.BlocksAny(ctx, request, header, protocol, pkg, stream, supportBuffering, logger) if err != nil { return err } diff --git a/service/testing.go b/service/testing.go index f49585d86..96c156a65 100644 --- a/service/testing.go +++ b/service/testing.go @@ -44,7 +44,7 @@ func (s *Tier1Service) TestBlocks(ctx context.Context, isSubRequest bool, reques return stream.NewErrInvalidArg("%s", err.Error()) } - return s.blocks(ctx, nil, request, nil, execGraph, respFunc, metrics.NewReqStats(&metrics.Config{}, nil, nil, zap.NewNop()), nil, 0) + return s.blocks(ctx, nil, request, nil, execGraph, respFunc, metrics.NewReqStats(&metrics.Config{}, nil, nil, zap.NewNop()), nil, false, 0) } func TestNewServiceTier2(moduleExecutionTracing bool, streamFactoryFunc StreamFactoryFunc) *Tier2Service { diff --git a/service/tier1.go b/service/tier1.go index f402ef176..ddab4caf5 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -39,6 +39,7 @@ import ( "github.com/streamingfast/substreams/orchestrator/plan" "github.com/streamingfast/substreams/orchestrator/work" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "github.com/streamingfast/substreams/pipeline" "github.com/streamingfast/substreams/pipeline/cache" @@ -305,6 +306,7 @@ func (s *Tier1Service) BlocksAny( protocol string, pkg *pbsubstreams.Package, stream grpc.ServerStream, + supportBuffering bool, logger *zap.Logger, ) (runningCtx context.Context, serverErr error, blockErr error) { if s.IsTerminating() { @@ -535,8 +537,9 @@ func (s *Tier1Service) BlocksAny( runningContext = reqctx.WithCancelFunc(runningContext, cancelRunning) // we pass this down so that the 'workerPool/requestPool' can cancel the running context - respFunc := tier1ResponseHandler(respContext, &mut, logger, stream, request.NoopMode, reqStats, request.DevOutputModules) - err = s.blocks(runningContext, cancelRunning, request, header, execGraph, respFunc, reqStats, fields, s.execOutMessageBufferSize) + respFunc := tier1ResponseHandler(respContext, &mut, logger, stream, request.NoopMode, reqStats, request.DevOutputModules, supportBuffering) + + err = s.blocks(runningContext, cancelRunning, request, header, execGraph, respFunc, reqStats, fields, supportBuffering, s.execOutMessageBufferSize) if err != nil { return runningContext, nil, err } @@ -614,7 +617,18 @@ func (s *Tier1Service) writeLastUsed(ctx context.Context, execGraph *exec.Graph, var IsValidCacheTag = regexp.MustCompile(`^[a-zA-Z0-9_-]+$`).MatchString -func (s *Tier1Service) blocks(ctx context.Context, cancelRunning context.CancelCauseFunc, request *pbsubstreamsrpc.Request, header http.Header, execGraph *exec.Graph, respFunc substreams.ResponseFunc, reqStats *metrics.Stats, logFields []zap.Field, execOutMessageBufferSize int) (err error) { +func (s *Tier1Service) blocks( + ctx context.Context, + cancelRunning context.CancelCauseFunc, + request *pbsubstreamsrpc.Request, + header http.Header, + execGraph *exec.Graph, + respFunc substreams.ResponseFunc, + reqStats *metrics.Stats, + logFields []zap.Field, + supportBuffering bool, + execOutMessageBufferSize int, +) (err error) { chainFirstStreamableBlock := bstream.GetProtocolFirstStreamableBlock if request.StartBlockNum > 0 && request.StartBlockNum < int64(chainFirstStreamableBlock) { return bsstream.NewErrInvalidArg("invalid start block %d, must be >= %d (the first streamable block of the chain)", request.StartBlockNum, chainFirstStreamableBlock) @@ -784,6 +798,7 @@ func (s *Tier1Service) blocks(ctx context.Context, cancelRunning context.CancelC }, s.foundationalEndpoints, execOutMessageBufferSize, + supportBuffering, opts..., ) @@ -1046,6 +1061,7 @@ func tier1ResponseHandler( noop bool, stats *metrics.Stats, debugOutputForModules []string, + supportBuffering bool, ) substreams.ResponseFunc { auth := dauth.FromContext(ctx) organizationID := auth.OrganizationID() @@ -1072,7 +1088,6 @@ func tier1ResponseHandler( //var buffer []*pbsubstreamsrpc.BlockScopedData return func(respAny substreams.ResponseFromAnyTier) error { - resp := respAny.(*pbsubstreamsrpc.Response) mut.Lock() defer mut.Unlock() @@ -1081,38 +1096,23 @@ func tier1ResponseHandler( return ctx.Err() } - var isData bool - if data := resp.GetBlockScopedData(); data != nil { - isData = true - if noop { - data.DebugMapOutputs = nil - data.DebugStoreOutputs = nil - data.Output = &pbsubstreamsrpc.MapModuleOutput{} - } - if debugOutputs != nil { - // Filter DebugMapOutputs - var filteredMapOutputs []*pbsubstreamsrpc.MapModuleOutput - for _, output := range data.DebugMapOutputs { - if _, exists := debugOutputs[output.Name]; exists { - filteredMapOutputs = append(filteredMapOutputs, output) - } - } - data.DebugMapOutputs = filteredMapOutputs - - // Filter DebugStoreOutputs - var filteredStoreOutputs []*pbsubstreamsrpc.StoreModuleOutput - for _, output := range data.DebugStoreOutputs { - if _, exists := debugOutputs[output.Name]; exists { - filteredStoreOutputs = append(filteredStoreOutputs, output) - } - } - data.DebugStoreOutputs = filteredStoreOutputs + isData := true + + switch r := respAny.(type) { + case *pbsubstreamsrpc.Response: + d := r.GetBlockScopedData() + filterData(d, noop, debugOutputs) + case *pbsubstreamsrpcv4.Response: + for _, d := range r.GetBlockScopedDatas().Items { + filterData(d, noop, debugOutputs) } + default: + isData = false } - egressBytes := proto.Size(resp) + egressBytes := proto.Size(respAny.(proto.Message)) begin := time.Now() - if err := streamSrv.SendMsg(resp); err != nil { + if err := streamSrv.SendMsg(respAny); err != nil { logger.Info("unable to send block probably due to client disconnecting", zap.String("user_id", organizationID), zap.String("api_key_id", apiKeyID), zap.Error(err)) return connect.NewError(connect.CodeUnavailable, err) } @@ -1129,6 +1129,33 @@ func tier1ResponseHandler( } } +func filterData(data *pbsubstreamsrpc.BlockScopedData, noop bool, debugOutputs map[string]struct{}) { + if noop { + data.DebugMapOutputs = nil + data.DebugStoreOutputs = nil + data.Output = &pbsubstreamsrpc.MapModuleOutput{} + } + if debugOutputs != nil { + // Filter DebugMapOutputs + var filteredMapOutputs []*pbsubstreamsrpc.MapModuleOutput + for _, output := range data.DebugMapOutputs { + if _, exists := debugOutputs[output.Name]; exists { + filteredMapOutputs = append(filteredMapOutputs, output) + } + } + data.DebugMapOutputs = filteredMapOutputs + + // Filter DebugStoreOutputs + var filteredStoreOutputs []*pbsubstreamsrpc.StoreModuleOutput + for _, output := range data.DebugStoreOutputs { + if _, exists := debugOutputs[output.Name]; exists { + filteredStoreOutputs = append(filteredStoreOutputs, output) + } + } + data.DebugStoreOutputs = filteredStoreOutputs + } +} + func (s *Tier1Service) containsDeterministicError(ctx context.Context, startBlock, endBlock uint64, execGraph *exec.Graph, cacheStore dstore.Store) error { for _, module := range execGraph.UsedModules() { diff --git a/service/tier2.go b/service/tier2.go index 5702b37b1..dd59e6d23 100644 --- a/service/tier2.go +++ b/service/tier2.go @@ -522,6 +522,7 @@ func (s *Tier2Service) processRange(ctx context.Context, request *pbssinternal.P s.checkPendingShutdown, request.FoundationalStoreEndpoints, 0, + false, opts..., ) diff --git a/sink/sinker.go b/sink/sinker.go index 85200e688..164f5221c 100644 --- a/sink/sinker.go +++ b/sink/sinker.go @@ -24,6 +24,7 @@ import ( pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" pbsubstreamsrpcv2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" pbsubstreamsrpcv3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "go.uber.org/zap" "google.golang.org/grpc" @@ -482,33 +483,40 @@ func (s *Sinker) doRequest( s.Logger.Debug("launching substreams request", zap.Int64("start_block", req.StartBlockNum), zap.Stringer("cursor", activeCursor)) receivedDataMessage := false - //md := metadata.Pairs("grpc-accept-encoding", "s2,identity") - //ctx = metadata.NewOutgoingContext(ctx, md) - - var stream grpc.ServerStreamingClient[pbsubstreamsrpc.Response] + var streamV23 grpc.ServerStreamingClient[pbsubstreamsrpc.Response] + var streamV4 grpc.ServerStreamingClient[pbsubstreamsrpcv4.Response] var err error ssClientV2 := pbsubstreamsrpcv2.NewStreamClient(conn) ssClientV3 := pbsubstreamsrpcv3.NewStreamClient(conn) + ssClientV4 := pbsubstreamsrpcv4.NewStreamClient(conn) var isRunningV2 bool - if forceProtocolVersion.IsV2() { + switch forceProtocolVersion { + case client.ProtocolVersionV2: reqV2, err := req.ToV2() if err != nil { return activeCursor, receivedDataMessage, fmt.Errorf("failed to convert request to v2: %w", err) } - stream, err = ssClientV2.Blocks(ctx, reqV2, callOpts...) + streamV23, err = ssClientV2.Blocks(ctx, reqV2, callOpts...) if err != nil { return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v2.Stream/Blocks: %w", err)) } isRunningV2 = true - } else { - stream, err = ssClientV3.Blocks(ctx, req, callOpts...) + + case client.ProtocolVersionV3: + streamV23, err = ssClientV3.Blocks(ctx, req, callOpts...) if err != nil { return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v3.Stream/Blocks: %w", err)) } + default: + streamV4, err = ssClientV4.Blocks(ctx, req, callOpts...) + if err != nil { + return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v4.Stream/Blocks: %w", err)) + } } + var prevBlockTime time.Time var afterReceive time.Time var lastMessageWasData bool @@ -525,7 +533,15 @@ func (s *Sinker) doRequest( lastMessageWasData = false // reset beforeReceive := time.Now() - resp, err := stream.Recv() + + var respV23 *pbsubstreamsrpc.Response + var respV4 *pbsubstreamsrpcv4.Response + + if streamV4 != nil { + respV4, err = streamV4.Recv() + } else { + respV23, err = streamV23.Recv() + } if err != nil { if errors.Is(err, io.EOF) { @@ -536,17 +552,48 @@ func (s *Sinker) doRequest( switch dgrpcError.Code() { case codes.Unimplemented, codes.NotFound: if forceProtocolVersion.IsUnset() && !isRunningV2 { - // fallback to use v2 if the server does not support v3 + // fallback logic: if v4 failed, we try v3, then v2 + // currently if v4 fails, it will try v2 directly because streamV23 is used for both v2 and v3 + // and we need to decide which one to try. + + // If we were running V4 (streamV4 != nil) and it failed with Unimplemented, let's try V3 + if streamV4 != nil { + s.Logger.Info("server does not implement sf.substreams.rpc.v4.Stream/Blocks, trying v3") + streamV23, err = ssClientV3.Blocks(ctx, req, callOpts...) + if err != nil { + // if v3 also fails immediately with unimplemented, we will hit this again and go to v2 + if dgrpcError := dgrpc.AsGRPCError(err); dgrpcError != nil && (dgrpcError.Code() == codes.Unimplemented || dgrpcError.Code() == codes.NotFound) { + s.Logger.Info("server does not implement sf.substreams.rpc.v3.Stream/Blocks, trying v2") + isRunningV2 = true + reqV2, err := req.ToV2() + if err != nil { + return activeCursor, receivedDataMessage, fmt.Errorf("failed to convert request to v2: %w", err) + } + streamV23, err = ssClientV2.Blocks(ctx, reqV2, callOpts...) + if err != nil { + return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v2.Stream/Blocks: %w", err)) + } + streamV4 = nil + continue + } + return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v3.Stream/Blocks: %w", err)) + } + streamV4 = nil + continue + } + + // Fallback to use v2 if the server does not support v3 s.Logger.Info("server does not implement sf.substreams.rpc.v3.Stream/Blocks, trying v2") isRunningV2 = true reqV2, err := req.ToV2() if err != nil { return activeCursor, receivedDataMessage, fmt.Errorf("failed to convert request to v2: %w", err) } - stream, err = ssClientV2.Blocks(ctx, reqV2, callOpts...) + streamV23, err = ssClientV2.Blocks(ctx, reqV2, callOpts...) if err != nil { return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v2.Stream/Blocks: %w", err)) } + streamV4 = nil continue } return activeCursor, receivedDataMessage, fmt.Errorf("stream auth failure: %w", err) @@ -575,9 +622,47 @@ func (s *Sinker) doRequest( return activeCursor, receivedDataMessage, retryable(err) } - MessageSizeBytes.AddInt(proto.Size(resp)) + var message any + if respV23 != nil { + MessageSizeBytes.AddInt(proto.Size(respV23)) + message = respV23.Message + } else { + MessageSizeBytes.AddInt(proto.Size(respV4)) + // Mapping v4 messages back to pbsubstreamsrpc.isResponse_Message (which is rpc.v2.isResponse_Message) + // This works for fields that have the same type in both. + switch r := respV4.Message.(type) { + case *pbsubstreamsrpcv4.Response_Session: + message = &pbsubstreamsrpc.Response_Session{Session: r.Session} + case *pbsubstreamsrpcv4.Response_Progress: + message = &pbsubstreamsrpc.Response_Progress{Progress: r.Progress} + case *pbsubstreamsrpcv4.Response_BlockUndoSignal: + message = &pbsubstreamsrpc.Response_BlockUndoSignal{BlockUndoSignal: r.BlockUndoSignal} + case *pbsubstreamsrpcv4.Response_FatalError: + message = &pbsubstreamsrpc.Response_FatalError{FatalError: r.FatalError} + case *pbsubstreamsrpcv4.Response_DebugSnapshotData: + message = &pbsubstreamsrpc.Response_DebugSnapshotData{DebugSnapshotData: r.DebugSnapshotData} + case *pbsubstreamsrpcv4.Response_DebugSnapshotComplete: + message = &pbsubstreamsrpc.Response_DebugSnapshotComplete{DebugSnapshotComplete: r.DebugSnapshotComplete} + case *pbsubstreamsrpcv4.Response_BlockScopedDatas: + // We don't map this to pbsubstreamsrpc.isResponse_Message because there is no equivalent + // We'll handle it specially below. + } + } - switch r := resp.Message.(type) { + if respV4 != nil { + if r, ok := respV4.Message.(*pbsubstreamsrpcv4.Response_BlockScopedDatas); ok { + for idx, item := range r.BlockScopedDatas.Items { + if activeCursor, receivedDataMessage, err = s.processBlockScopedData(ctx, handler, item, idx == 0, beforeReceive, &prevBlockTime, activeCursor); err != nil { + return activeCursor, receivedDataMessage, err + } + afterReceive = time.Now() + lastMessageWasData = true + } + continue + } + } + + switch r := message.(type) { case *pbsubstreamsrpc.Response_Progress: if ph, ok := handler.(SinkerProgressHandler); ok { ph.HandleProgress(ctx, r.Progress) @@ -633,14 +718,6 @@ func (s *Sinker) doRequest( s.Logger.Debug("received response Progress", zap.Reflect("progress", r)) } - case *pbsubstreamsrpc.Response_BlockScopedDatas: - for idx, item := range r.BlockScopedDatas.Items { - if activeCursor, receivedDataMessage, err = s.processBlockScopedData(ctx, handler, item, idx == 0, beforeReceive, &prevBlockTime, activeCursor); err != nil { - return activeCursor, receivedDataMessage, err - } - afterReceive = time.Now() - lastMessageWasData = true - } case *pbsubstreamsrpc.Response_BlockScopedData: if activeCursor, receivedDataMessage, err = s.processBlockScopedData(ctx, handler, r.BlockScopedData, true, beforeReceive, &prevBlockTime, activeCursor); err != nil { return activeCursor, receivedDataMessage, err diff --git a/types.go b/types.go index d264a6d72..4174bdb7b 100644 --- a/types.go +++ b/types.go @@ -5,6 +5,7 @@ import ( pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" ) @@ -18,9 +19,9 @@ func NewBlockScopedDataResponse(in *pbsubstreamsrpc.BlockScopedData) *pbsubstrea Message: &pbsubstreamsrpc.Response_BlockScopedData{BlockScopedData: in}, } } -func NewBlockScopedDatasResponse(in *pbsubstreamsrpc.BlockScopedDatas) *pbsubstreamsrpc.Response { - return &pbsubstreamsrpc.Response{ - Message: &pbsubstreamsrpc.Response_BlockScopedDatas{BlockScopedDatas: in}, +func NewBlockScopedDatasResponse(in *pbsubstreamsrpcv4.BlockScopedDatas) *pbsubstreamsrpcv4.Response { + return &pbsubstreamsrpcv4.Response{ + Message: &pbsubstreamsrpcv4.Response_BlockScopedDatas{BlockScopedDatas: in}, } } func NewBlockScopedDataInternResponse(in *pbssinternal.BlockScopedData) *pbssinternal.ProcessRangeResponse { From acaaeca0aff591c1c2ee435c92dd38523759f54b Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Fri, 13 Feb 2026 13:13:00 -0500 Subject: [PATCH 39/47] Introduce v4 RPC API for `BlockScopedDatas` and refactor dependent services and structures --- .../service.connect.go | 125 ++ pb/sf/substreams/rpc/v4/service.pb.go | 332 +++++ pb/sf/substreams/rpc/v4/service_grpc.pb.go | 135 ++ pb/sf/substreams/rpc/v4/service_vtproto.pb.go | 1117 +++++++++++++++++ 4 files changed, 1709 insertions(+) create mode 100644 pb/sf/substreams/rpc/v4/pbsubstreamsrpcv4connect/service.connect.go create mode 100644 pb/sf/substreams/rpc/v4/service.pb.go create mode 100644 pb/sf/substreams/rpc/v4/service_grpc.pb.go create mode 100644 pb/sf/substreams/rpc/v4/service_vtproto.pb.go diff --git a/pb/sf/substreams/rpc/v4/pbsubstreamsrpcv4connect/service.connect.go b/pb/sf/substreams/rpc/v4/pbsubstreamsrpcv4connect/service.connect.go new file mode 100644 index 000000000..ffceda3e8 --- /dev/null +++ b/pb/sf/substreams/rpc/v4/pbsubstreamsrpcv4connect/service.connect.go @@ -0,0 +1,125 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: sf/substreams/rpc/v4/service.proto + +package pbsubstreamsrpcv4connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + v4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // StreamName is the fully-qualified name of the Stream service. + StreamName = "sf.substreams.rpc.v4.Stream" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // StreamBlocksProcedure is the fully-qualified name of the Stream's Blocks RPC. + StreamBlocksProcedure = "/sf.substreams.rpc.v4.Stream/Blocks" +) + +// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. +var ( + streamServiceDescriptor = v4.File_sf_substreams_rpc_v4_service_proto.Services().ByName("Stream") + streamBlocksMethodDescriptor = streamServiceDescriptor.Methods().ByName("Blocks") +) + +// StreamClient is a client for the sf.substreams.rpc.v4.Stream service. +type StreamClient interface { + // Request processing of blocks via substreams engine. + // Similar to `sf.substreams.rpc.v2.Stream/Blocks` request, but: + // - the full spkg package is sent instead of just the modules + // - 'params' and 'network' fields are sent to apply the user-defined params to the package server-side + // + // Responses are identical to those of the v2 request. + Blocks(context.Context, *connect.Request[v3.Request]) (*connect.ServerStreamForClient[v4.Response], error) +} + +// NewStreamClient constructs a client for the sf.substreams.rpc.v4.Stream service. By default, it +// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends +// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or +// connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewStreamClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) StreamClient { + baseURL = strings.TrimRight(baseURL, "/") + return &streamClient{ + blocks: connect.NewClient[v3.Request, v4.Response]( + httpClient, + baseURL+StreamBlocksProcedure, + connect.WithSchema(streamBlocksMethodDescriptor), + connect.WithClientOptions(opts...), + ), + } +} + +// streamClient implements StreamClient. +type streamClient struct { + blocks *connect.Client[v3.Request, v4.Response] +} + +// Blocks calls sf.substreams.rpc.v4.Stream.Blocks. +func (c *streamClient) Blocks(ctx context.Context, req *connect.Request[v3.Request]) (*connect.ServerStreamForClient[v4.Response], error) { + return c.blocks.CallServerStream(ctx, req) +} + +// StreamHandler is an implementation of the sf.substreams.rpc.v4.Stream service. +type StreamHandler interface { + // Request processing of blocks via substreams engine. + // Similar to `sf.substreams.rpc.v2.Stream/Blocks` request, but: + // - the full spkg package is sent instead of just the modules + // - 'params' and 'network' fields are sent to apply the user-defined params to the package server-side + // + // Responses are identical to those of the v2 request. + Blocks(context.Context, *connect.Request[v3.Request], *connect.ServerStream[v4.Response]) error +} + +// NewStreamHandler builds an HTTP handler from the service implementation. It returns the path on +// which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewStreamHandler(svc StreamHandler, opts ...connect.HandlerOption) (string, http.Handler) { + streamBlocksHandler := connect.NewServerStreamHandler( + StreamBlocksProcedure, + svc.Blocks, + connect.WithSchema(streamBlocksMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) + return "/sf.substreams.rpc.v4.Stream/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case StreamBlocksProcedure: + streamBlocksHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedStreamHandler returns CodeUnimplemented from all methods. +type UnimplementedStreamHandler struct{} + +func (UnimplementedStreamHandler) Blocks(context.Context, *connect.Request[v3.Request], *connect.ServerStream[v4.Response]) error { + return connect.NewError(connect.CodeUnimplemented, errors.New("sf.substreams.rpc.v4.Stream.Blocks is not implemented")) +} diff --git a/pb/sf/substreams/rpc/v4/service.pb.go b/pb/sf/substreams/rpc/v4/service.pb.go new file mode 100644 index 000000000..fd8e1dc38 --- /dev/null +++ b/pb/sf/substreams/rpc/v4/service.pb.go @@ -0,0 +1,332 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc (unknown) +// source: sf/substreams/rpc/v4/service.proto + +package pbsubstreamsrpcv4 + +import ( + _ "github.com/streamingfast/pbgo/sf/firehose/v2" + v2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + v3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + _ "github.com/streamingfast/substreams/pb/sf/substreams/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/anypb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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) +) + +type Response struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Message: + // + // *Response_Session + // *Response_Progress + // *Response_BlockScopedDatas + // *Response_BlockUndoSignal + // *Response_FatalError + // *Response_DebugSnapshotData + // *Response_DebugSnapshotComplete + Message isResponse_Message `protobuf_oneof:"message"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Response) Reset() { + *x = Response{} + mi := &file_sf_substreams_rpc_v4_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_sf_substreams_rpc_v4_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_sf_substreams_rpc_v4_service_proto_rawDescGZIP(), []int{0} +} + +func (x *Response) GetMessage() isResponse_Message { + if x != nil { + return x.Message + } + return nil +} + +func (x *Response) GetSession() *v2.SessionInit { + if x != nil { + if x, ok := x.Message.(*Response_Session); ok { + return x.Session + } + } + return nil +} + +func (x *Response) GetProgress() *v2.ModulesProgress { + if x != nil { + if x, ok := x.Message.(*Response_Progress); ok { + return x.Progress + } + } + return nil +} + +func (x *Response) GetBlockScopedDatas() *BlockScopedDatas { + if x != nil { + if x, ok := x.Message.(*Response_BlockScopedDatas); ok { + return x.BlockScopedDatas + } + } + return nil +} + +func (x *Response) GetBlockUndoSignal() *v2.BlockUndoSignal { + if x != nil { + if x, ok := x.Message.(*Response_BlockUndoSignal); ok { + return x.BlockUndoSignal + } + } + return nil +} + +func (x *Response) GetFatalError() *v2.Error { + if x != nil { + if x, ok := x.Message.(*Response_FatalError); ok { + return x.FatalError + } + } + return nil +} + +func (x *Response) GetDebugSnapshotData() *v2.InitialSnapshotData { + if x != nil { + if x, ok := x.Message.(*Response_DebugSnapshotData); ok { + return x.DebugSnapshotData + } + } + return nil +} + +func (x *Response) GetDebugSnapshotComplete() *v2.InitialSnapshotComplete { + if x != nil { + if x, ok := x.Message.(*Response_DebugSnapshotComplete); ok { + return x.DebugSnapshotComplete + } + } + return nil +} + +type isResponse_Message interface { + isResponse_Message() +} + +type Response_Session struct { + Session *v2.SessionInit `protobuf:"bytes,1,opt,name=session,proto3,oneof"` // Always sent first +} + +type Response_Progress struct { + Progress *v2.ModulesProgress `protobuf:"bytes,2,opt,name=progress,proto3,oneof"` // Progress of data preparation, before sending in the stream of `data` events. +} + +type Response_BlockScopedDatas struct { + BlockScopedDatas *BlockScopedDatas `protobuf:"bytes,3,opt,name=block_scoped_datas,json=blockScopedDatas,proto3,oneof"` +} + +type Response_BlockUndoSignal struct { + BlockUndoSignal *v2.BlockUndoSignal `protobuf:"bytes,4,opt,name=block_undo_signal,json=blockUndoSignal,proto3,oneof"` +} + +type Response_FatalError struct { + FatalError *v2.Error `protobuf:"bytes,5,opt,name=fatal_error,json=fatalError,proto3,oneof"` +} + +type Response_DebugSnapshotData struct { + // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. + DebugSnapshotData *v2.InitialSnapshotData `protobuf:"bytes,10,opt,name=debug_snapshot_data,json=debugSnapshotData,proto3,oneof"` +} + +type Response_DebugSnapshotComplete struct { + // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set. + DebugSnapshotComplete *v2.InitialSnapshotComplete `protobuf:"bytes,11,opt,name=debug_snapshot_complete,json=debugSnapshotComplete,proto3,oneof"` +} + +func (*Response_Session) isResponse_Message() {} + +func (*Response_Progress) isResponse_Message() {} + +func (*Response_BlockScopedDatas) isResponse_Message() {} + +func (*Response_BlockUndoSignal) isResponse_Message() {} + +func (*Response_FatalError) isResponse_Message() {} + +func (*Response_DebugSnapshotData) isResponse_Message() {} + +func (*Response_DebugSnapshotComplete) isResponse_Message() {} + +type BlockScopedDatas struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []*v2.BlockScopedData `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockScopedDatas) Reset() { + *x = BlockScopedDatas{} + mi := &file_sf_substreams_rpc_v4_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockScopedDatas) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockScopedDatas) ProtoMessage() {} + +func (x *BlockScopedDatas) ProtoReflect() protoreflect.Message { + mi := &file_sf_substreams_rpc_v4_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockScopedDatas.ProtoReflect.Descriptor instead. +func (*BlockScopedDatas) Descriptor() ([]byte, []int) { + return file_sf_substreams_rpc_v4_service_proto_rawDescGZIP(), []int{1} +} + +func (x *BlockScopedDatas) GetItems() []*v2.BlockScopedData { + if x != nil { + return x.Items + } + return nil +} + +var File_sf_substreams_rpc_v4_service_proto protoreflect.FileDescriptor + +const file_sf_substreams_rpc_v4_service_proto_rawDesc = "" + + "\n" + + "\"sf/substreams/rpc/v4/service.proto\x12\x14sf.substreams.rpc.v4\x1a\x19google/protobuf/any.proto\x1a\x1dsf/firehose/v2/firehose.proto\x1a\"sf/substreams/rpc/v2/service.proto\x1a\"sf/substreams/rpc/v3/service.proto\x1a\x1csf/substreams/v1/clock.proto\x1a\x1esf/substreams/v1/modules.proto\x1a\x1esf/substreams/v1/package.proto\"\xcc\x04\n" + + "\bResponse\x12=\n" + + "\asession\x18\x01 \x01(\v2!.sf.substreams.rpc.v2.SessionInitH\x00R\asession\x12C\n" + + "\bprogress\x18\x02 \x01(\v2%.sf.substreams.rpc.v2.ModulesProgressH\x00R\bprogress\x12V\n" + + "\x12block_scoped_datas\x18\x03 \x01(\v2&.sf.substreams.rpc.v4.BlockScopedDatasH\x00R\x10blockScopedDatas\x12S\n" + + "\x11block_undo_signal\x18\x04 \x01(\v2%.sf.substreams.rpc.v2.BlockUndoSignalH\x00R\x0fblockUndoSignal\x12>\n" + + "\vfatal_error\x18\x05 \x01(\v2\x1b.sf.substreams.rpc.v2.ErrorH\x00R\n" + + "fatalError\x12[\n" + + "\x13debug_snapshot_data\x18\n" + + " \x01(\v2).sf.substreams.rpc.v2.InitialSnapshotDataH\x00R\x11debugSnapshotData\x12g\n" + + "\x17debug_snapshot_complete\x18\v \x01(\v2-.sf.substreams.rpc.v2.InitialSnapshotCompleteH\x00R\x15debugSnapshotCompleteB\t\n" + + "\amessage\"O\n" + + "\x10BlockScopedDatas\x12;\n" + + "\x05items\x18\x01 \x03(\v2%.sf.substreams.rpc.v2.BlockScopedDataR\x05items2S\n" + + "\x06Stream\x12I\n" + + "\x06Blocks\x12\x1d.sf.substreams.rpc.v3.Request\x1a\x1e.sf.substreams.rpc.v4.Response0\x01BOZMgithub.com/streamingfast/substreams/pb/sf/substreams/rpc/v4;pbsubstreamsrpcv4b\x06proto3" + +var ( + file_sf_substreams_rpc_v4_service_proto_rawDescOnce sync.Once + file_sf_substreams_rpc_v4_service_proto_rawDescData []byte +) + +func file_sf_substreams_rpc_v4_service_proto_rawDescGZIP() []byte { + file_sf_substreams_rpc_v4_service_proto_rawDescOnce.Do(func() { + file_sf_substreams_rpc_v4_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sf_substreams_rpc_v4_service_proto_rawDesc), len(file_sf_substreams_rpc_v4_service_proto_rawDesc))) + }) + return file_sf_substreams_rpc_v4_service_proto_rawDescData +} + +var file_sf_substreams_rpc_v4_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_sf_substreams_rpc_v4_service_proto_goTypes = []any{ + (*Response)(nil), // 0: sf.substreams.rpc.v4.Response + (*BlockScopedDatas)(nil), // 1: sf.substreams.rpc.v4.BlockScopedDatas + (*v2.SessionInit)(nil), // 2: sf.substreams.rpc.v2.SessionInit + (*v2.ModulesProgress)(nil), // 3: sf.substreams.rpc.v2.ModulesProgress + (*v2.BlockUndoSignal)(nil), // 4: sf.substreams.rpc.v2.BlockUndoSignal + (*v2.Error)(nil), // 5: sf.substreams.rpc.v2.Error + (*v2.InitialSnapshotData)(nil), // 6: sf.substreams.rpc.v2.InitialSnapshotData + (*v2.InitialSnapshotComplete)(nil), // 7: sf.substreams.rpc.v2.InitialSnapshotComplete + (*v2.BlockScopedData)(nil), // 8: sf.substreams.rpc.v2.BlockScopedData + (*v3.Request)(nil), // 9: sf.substreams.rpc.v3.Request +} +var file_sf_substreams_rpc_v4_service_proto_depIdxs = []int32{ + 2, // 0: sf.substreams.rpc.v4.Response.session:type_name -> sf.substreams.rpc.v2.SessionInit + 3, // 1: sf.substreams.rpc.v4.Response.progress:type_name -> sf.substreams.rpc.v2.ModulesProgress + 1, // 2: sf.substreams.rpc.v4.Response.block_scoped_datas:type_name -> sf.substreams.rpc.v4.BlockScopedDatas + 4, // 3: sf.substreams.rpc.v4.Response.block_undo_signal:type_name -> sf.substreams.rpc.v2.BlockUndoSignal + 5, // 4: sf.substreams.rpc.v4.Response.fatal_error:type_name -> sf.substreams.rpc.v2.Error + 6, // 5: sf.substreams.rpc.v4.Response.debug_snapshot_data:type_name -> sf.substreams.rpc.v2.InitialSnapshotData + 7, // 6: sf.substreams.rpc.v4.Response.debug_snapshot_complete:type_name -> sf.substreams.rpc.v2.InitialSnapshotComplete + 8, // 7: sf.substreams.rpc.v4.BlockScopedDatas.items:type_name -> sf.substreams.rpc.v2.BlockScopedData + 9, // 8: sf.substreams.rpc.v4.Stream.Blocks:input_type -> sf.substreams.rpc.v3.Request + 0, // 9: sf.substreams.rpc.v4.Stream.Blocks:output_type -> sf.substreams.rpc.v4.Response + 9, // [9:10] is the sub-list for method output_type + 8, // [8:9] 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_sf_substreams_rpc_v4_service_proto_init() } +func file_sf_substreams_rpc_v4_service_proto_init() { + if File_sf_substreams_rpc_v4_service_proto != nil { + return + } + file_sf_substreams_rpc_v4_service_proto_msgTypes[0].OneofWrappers = []any{ + (*Response_Session)(nil), + (*Response_Progress)(nil), + (*Response_BlockScopedDatas)(nil), + (*Response_BlockUndoSignal)(nil), + (*Response_FatalError)(nil), + (*Response_DebugSnapshotData)(nil), + (*Response_DebugSnapshotComplete)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sf_substreams_rpc_v4_service_proto_rawDesc), len(file_sf_substreams_rpc_v4_service_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sf_substreams_rpc_v4_service_proto_goTypes, + DependencyIndexes: file_sf_substreams_rpc_v4_service_proto_depIdxs, + MessageInfos: file_sf_substreams_rpc_v4_service_proto_msgTypes, + }.Build() + File_sf_substreams_rpc_v4_service_proto = out.File + file_sf_substreams_rpc_v4_service_proto_goTypes = nil + file_sf_substreams_rpc_v4_service_proto_depIdxs = nil +} diff --git a/pb/sf/substreams/rpc/v4/service_grpc.pb.go b/pb/sf/substreams/rpc/v4/service_grpc.pb.go new file mode 100644 index 000000000..ea6bcc5e6 --- /dev/null +++ b/pb/sf/substreams/rpc/v4/service_grpc.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: sf/substreams/rpc/v4/service.proto + +package pbsubstreamsrpcv4 + +import ( + context "context" + v3 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v3" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Stream_Blocks_FullMethodName = "/sf.substreams.rpc.v4.Stream/Blocks" +) + +// StreamClient is the client API for Stream 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 StreamClient interface { + // Request processing of blocks via substreams engine. + // Similar to `sf.substreams.rpc.v2.Stream/Blocks` request, but: + // - the full spkg package is sent instead of just the modules + // - 'params' and 'network' fields are sent to apply the user-defined params to the package server-side + // + // Responses are identical to those of the v2 request. + Blocks(ctx context.Context, in *v3.Request, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Response], error) +} + +type streamClient struct { + cc grpc.ClientConnInterface +} + +func NewStreamClient(cc grpc.ClientConnInterface) StreamClient { + return &streamClient{cc} +} + +func (c *streamClient) Blocks(ctx context.Context, in *v3.Request, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Response], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Stream_ServiceDesc.Streams[0], Stream_Blocks_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[v3.Request, Response]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Stream_BlocksClient = grpc.ServerStreamingClient[Response] + +// StreamServer is the server API for Stream service. +// All implementations should embed UnimplementedStreamServer +// for forward compatibility. +type StreamServer interface { + // Request processing of blocks via substreams engine. + // Similar to `sf.substreams.rpc.v2.Stream/Blocks` request, but: + // - the full spkg package is sent instead of just the modules + // - 'params' and 'network' fields are sent to apply the user-defined params to the package server-side + // + // Responses are identical to those of the v2 request. + Blocks(*v3.Request, grpc.ServerStreamingServer[Response]) error +} + +// UnimplementedStreamServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStreamServer struct{} + +func (UnimplementedStreamServer) Blocks(*v3.Request, grpc.ServerStreamingServer[Response]) error { + return status.Errorf(codes.Unimplemented, "method Blocks not implemented") +} +func (UnimplementedStreamServer) testEmbeddedByValue() {} + +// UnsafeStreamServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StreamServer will +// result in compilation errors. +type UnsafeStreamServer interface { + mustEmbedUnimplementedStreamServer() +} + +func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer) { + // If the following call pancis, it indicates UnimplementedStreamServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Stream_ServiceDesc, srv) +} + +func _Stream_Blocks_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(v3.Request) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StreamServer).Blocks(m, &grpc.GenericServerStream[v3.Request, Response]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Stream_BlocksServer = grpc.ServerStreamingServer[Response] + +// Stream_ServiceDesc is the grpc.ServiceDesc for Stream service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Stream_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sf.substreams.rpc.v4.Stream", + HandlerType: (*StreamServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Blocks", + Handler: _Stream_Blocks_Handler, + ServerStreams: true, + }, + }, + Metadata: "sf/substreams/rpc/v4/service.proto", +} diff --git a/pb/sf/substreams/rpc/v4/service_vtproto.pb.go b/pb/sf/substreams/rpc/v4/service_vtproto.pb.go new file mode 100644 index 000000000..02ff47ff1 --- /dev/null +++ b/pb/sf/substreams/rpc/v4/service_vtproto.pb.go @@ -0,0 +1,1117 @@ +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.6.0 +// source: sf/substreams/rpc/v4/service.proto + +package pbsubstreamsrpcv4 + +import ( + fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + v2 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" +) + +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) +) + +func (m *Response) CloneVT() *Response { + if m == nil { + return (*Response)(nil) + } + r := new(Response) + if m.Message != nil { + r.Message = m.Message.(interface{ CloneVT() isResponse_Message }).CloneVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *Response) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *Response_Session) CloneVT() isResponse_Message { + if m == nil { + return (*Response_Session)(nil) + } + r := new(Response_Session) + r.Session = m.Session.CloneVT() + return r +} + +func (m *Response_Progress) CloneVT() isResponse_Message { + if m == nil { + return (*Response_Progress)(nil) + } + r := new(Response_Progress) + r.Progress = m.Progress.CloneVT() + return r +} + +func (m *Response_BlockScopedDatas) CloneVT() isResponse_Message { + if m == nil { + return (*Response_BlockScopedDatas)(nil) + } + r := new(Response_BlockScopedDatas) + r.BlockScopedDatas = m.BlockScopedDatas.CloneVT() + return r +} + +func (m *Response_BlockUndoSignal) CloneVT() isResponse_Message { + if m == nil { + return (*Response_BlockUndoSignal)(nil) + } + r := new(Response_BlockUndoSignal) + r.BlockUndoSignal = m.BlockUndoSignal.CloneVT() + return r +} + +func (m *Response_FatalError) CloneVT() isResponse_Message { + if m == nil { + return (*Response_FatalError)(nil) + } + r := new(Response_FatalError) + r.FatalError = m.FatalError.CloneVT() + return r +} + +func (m *Response_DebugSnapshotData) CloneVT() isResponse_Message { + if m == nil { + return (*Response_DebugSnapshotData)(nil) + } + r := new(Response_DebugSnapshotData) + r.DebugSnapshotData = m.DebugSnapshotData.CloneVT() + return r +} + +func (m *Response_DebugSnapshotComplete) CloneVT() isResponse_Message { + if m == nil { + return (*Response_DebugSnapshotComplete)(nil) + } + r := new(Response_DebugSnapshotComplete) + r.DebugSnapshotComplete = m.DebugSnapshotComplete.CloneVT() + return r +} + +func (m *BlockScopedDatas) CloneVT() *BlockScopedDatas { + if m == nil { + return (*BlockScopedDatas)(nil) + } + r := new(BlockScopedDatas) + if rhs := m.Items; rhs != nil { + tmpContainer := make([]*v2.BlockScopedData, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Items = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *BlockScopedDatas) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (this *Response) EqualVT(that *Response) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Message == nil && that.Message != nil { + return false + } else if this.Message != nil { + if that.Message == nil { + return false + } + if !this.Message.(interface{ EqualVT(isResponse_Message) bool }).EqualVT(that.Message) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Response) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*Response) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *Response_Session) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_Session) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Session, that.Session; p != q { + if p == nil { + p = &v2.SessionInit{} + } + if q == nil { + q = &v2.SessionInit{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_Progress) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_Progress) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.Progress, that.Progress; p != q { + if p == nil { + p = &v2.ModulesProgress{} + } + if q == nil { + q = &v2.ModulesProgress{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_BlockScopedDatas) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_BlockScopedDatas) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.BlockScopedDatas, that.BlockScopedDatas; p != q { + if p == nil { + p = &BlockScopedDatas{} + } + if q == nil { + q = &BlockScopedDatas{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_BlockUndoSignal) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_BlockUndoSignal) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.BlockUndoSignal, that.BlockUndoSignal; p != q { + if p == nil { + p = &v2.BlockUndoSignal{} + } + if q == nil { + q = &v2.BlockUndoSignal{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_FatalError) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_FatalError) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.FatalError, that.FatalError; p != q { + if p == nil { + p = &v2.Error{} + } + if q == nil { + q = &v2.Error{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_DebugSnapshotData) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_DebugSnapshotData) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.DebugSnapshotData, that.DebugSnapshotData; p != q { + if p == nil { + p = &v2.InitialSnapshotData{} + } + if q == nil { + q = &v2.InitialSnapshotData{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *Response_DebugSnapshotComplete) EqualVT(thatIface isResponse_Message) bool { + that, ok := thatIface.(*Response_DebugSnapshotComplete) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if p, q := this.DebugSnapshotComplete, that.DebugSnapshotComplete; p != q { + if p == nil { + p = &v2.InitialSnapshotComplete{} + } + if q == nil { + q = &v2.InitialSnapshotComplete{} + } + if !p.EqualVT(q) { + return false + } + } + return true +} + +func (this *BlockScopedDatas) EqualVT(that *BlockScopedDatas) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Items) != len(that.Items) { + return false + } + for i, vx := range this.Items { + vy := that.Items[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &v2.BlockScopedData{} + } + if q == nil { + q = &v2.BlockScopedData{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *BlockScopedDatas) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*BlockScopedDatas) + if !ok { + return false + } + return this.EqualVT(that) +} +func (m *Response) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Response) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.Message.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *Response_Session) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_Session) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Session != nil { + size, err := m.Session.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Response_Progress) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_Progress) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Progress != nil { + size, err := m.Progress.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Response_BlockScopedDatas) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_BlockScopedDatas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BlockScopedDatas != nil { + size, err := m.BlockScopedDatas.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Response_BlockUndoSignal) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_BlockUndoSignal) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BlockUndoSignal != nil { + size, err := m.BlockUndoSignal.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Response_FatalError) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_FatalError) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FatalError != nil { + size, err := m.FatalError.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Response_DebugSnapshotData) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_DebugSnapshotData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DebugSnapshotData != nil { + size, err := m.DebugSnapshotData.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + return len(dAtA) - i, nil +} +func (m *Response_DebugSnapshotComplete) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Response_DebugSnapshotComplete) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DebugSnapshotComplete != nil { + size, err := m.DebugSnapshotComplete.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + return len(dAtA) - i, nil +} +func (m *BlockScopedDatas) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockScopedDatas) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *BlockScopedDatas) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Items[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Response) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Message.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *Response_Session) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Session != nil { + l = m.Session.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_Progress) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Progress != nil { + l = m.Progress.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_BlockScopedDatas) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockScopedDatas != nil { + l = m.BlockScopedDatas.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_BlockUndoSignal) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockUndoSignal != nil { + l = m.BlockUndoSignal.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_FatalError) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FatalError != nil { + l = m.FatalError.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_DebugSnapshotData) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DebugSnapshotData != nil { + l = m.DebugSnapshotData.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *Response_DebugSnapshotComplete) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DebugSnapshotComplete != nil { + l = m.DebugSnapshotComplete.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + return n +} +func (m *BlockScopedDatas) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Response) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Session", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_Session); ok { + if err := oneof.Session.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &v2.SessionInit{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_Session{Session: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Progress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_Progress); ok { + if err := oneof.Progress.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &v2.ModulesProgress{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_Progress{Progress: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockScopedDatas", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_BlockScopedDatas); ok { + if err := oneof.BlockScopedDatas.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &BlockScopedDatas{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_BlockScopedDatas{BlockScopedDatas: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockUndoSignal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_BlockUndoSignal); ok { + if err := oneof.BlockUndoSignal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &v2.BlockUndoSignal{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_BlockUndoSignal{BlockUndoSignal: v} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FatalError", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_FatalError); ok { + if err := oneof.FatalError.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &v2.Error{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_FatalError{FatalError: v} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugSnapshotData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_DebugSnapshotData); ok { + if err := oneof.DebugSnapshotData.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &v2.InitialSnapshotData{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_DebugSnapshotData{DebugSnapshotData: v} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DebugSnapshotComplete", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if oneof, ok := m.Message.(*Response_DebugSnapshotComplete); ok { + if err := oneof.DebugSnapshotComplete.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + } else { + v := &v2.InitialSnapshotComplete{} + if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Message = &Response_DebugSnapshotComplete{DebugSnapshotComplete: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockScopedDatas) UnmarshalVT(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 protohelpers.ErrIntOverflow + } + 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: BlockScopedDatas: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockScopedDatas: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, &v2.BlockScopedData{}) + if err := m.Items[len(m.Items)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} From 0a3e638e8b1efbb4094c38897df297b76ce71896 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Mon, 16 Feb 2026 09:13:04 -0500 Subject: [PATCH 40/47] Fix nil pointer --- service/tier1.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/service/tier1.go b/service/tier1.go index ddab4caf5..4153dad45 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -1096,18 +1096,21 @@ func tier1ResponseHandler( return ctx.Err() } - isData := true + isData := false switch r := respAny.(type) { case *pbsubstreamsrpc.Response: d := r.GetBlockScopedData() - filterData(d, noop, debugOutputs) + if d != nil { + isData = true + filterData(d, noop, debugOutputs) + } case *pbsubstreamsrpcv4.Response: for _, d := range r.GetBlockScopedDatas().Items { - filterData(d, noop, debugOutputs) + if d != nil { + filterData(d, noop, debugOutputs) + } } - default: - isData = false } egressBytes := proto.Size(respAny.(proto.Message)) From baee74d4ce5e2817eeb4bc351defe2a034f9b73e Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Mon, 16 Feb 2026 11:06:34 -0500 Subject: [PATCH 41/47] Fix nil pointer --- pipeline/pipeline.go | 15 +++++++++++++++ pipeline/process_block.go | 2 +- service/tier1.go | 3 +++ sink/sinker.go | 7 +++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index e1ab958ea..38cea2678 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -24,6 +24,7 @@ import ( pbservice "github.com/streamingfast/substreams/pb/sf/substreams/foundational-store/service/v2" pbssinternal "github.com/streamingfast/substreams/pb/sf/substreams/intern/v2" pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2" + pbsubstreamsrpcv4 "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v4" pbsubstreams "github.com/streamingfast/substreams/pb/sf/substreams/v1" "github.com/streamingfast/substreams/pipeline/cache" "github.com/streamingfast/substreams/pipeline/exec" @@ -951,6 +952,7 @@ func returnModuleDataOutputs( extraMapModuleOutputs []*pbsubstreamsrpc.MapModuleOutput, extraStoreModuleOutputs []*pbsubstreamsrpc.StoreModuleOutput, respFunc substreams.ResponseFunc, + supportBuffering bool, logger *zap.Logger, ) error { @@ -968,6 +970,19 @@ func returnModuleDataOutputs( FinalBlockHeight: cursor.LIB.Num(), } + if supportBuffering { //v4 support + bsd := &pbsubstreamsrpcv4.BlockScopedDatas{ + Items: []*pbsubstreamsrpc.BlockScopedData{ + out, + }, + } + + if err := respFunc(substreams.NewBlockScopedDatasResponse(bsd)); err != nil { + return fmt.Errorf("calling return func: %w", err) + } + return nil + } + if err := respFunc(substreams.NewBlockScopedDataResponse(out)); err != nil { return fmt.Errorf("calling return func: %w", err) } diff --git a/pipeline/process_block.go b/pipeline/process_block.go index a08d21001..22f5b9cca 100644 --- a/pipeline/process_block.go +++ b/pipeline/process_block.go @@ -494,7 +494,7 @@ func (p *Pipeline) handleStepNew(ctx context.Context, clock *pbsubstreams.Clock, if p.partialProcessingState == nil { mapModuleOutput := normalizeModuleOutput(p.mapModuleOutput, reqDetails.OutputModule) p.sentBlocks++ - if err = returnModuleDataOutputs(clock, cursor, mapModuleOutput, p.extraMapModuleOutputs, p.extraStoreModuleOutputs, p.respFunc, logger); err != nil { + if err = returnModuleDataOutputs(clock, cursor, mapModuleOutput, p.extraMapModuleOutputs, p.extraStoreModuleOutputs, p.respFunc, p.supportBuffering, logger); err != nil { return fmt.Errorf("failed to return module data output: %w", err) } } diff --git a/service/tier1.go b/service/tier1.go index 4153dad45..d41bf1165 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -1102,6 +1102,9 @@ func tier1ResponseHandler( case *pbsubstreamsrpc.Response: d := r.GetBlockScopedData() if d != nil { + if supportBuffering { + return fmt.Errorf("receive a single block scoped data response, but supportBuffering is enabled") + } isData = true filterData(d, noop, debugOutputs) } diff --git a/sink/sinker.go b/sink/sinker.go index 164f5221c..5d2ef07a8 100644 --- a/sink/sinker.go +++ b/sink/sinker.go @@ -504,17 +504,19 @@ func (s *Sinker) doRequest( return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v2.Stream/Blocks: %w", err)) } isRunningV2 = true - + s.Logger.Info("substreams using protocol version v2") case client.ProtocolVersionV3: streamV23, err = ssClientV3.Blocks(ctx, req, callOpts...) if err != nil { return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v3.Stream/Blocks: %w", err)) } + s.Logger.Info("substreams using protocol version v3") default: streamV4, err = ssClientV4.Blocks(ctx, req, callOpts...) if err != nil { return activeCursor, receivedDataMessage, retryable(fmt.Errorf("call sf.substreams.rpc.v4.Stream/Blocks: %w", err)) } + s.Logger.Info("substreams using protocol version v4") } var prevBlockTime time.Time @@ -650,10 +652,11 @@ func (s *Sinker) doRequest( } if respV4 != nil { + s.Logger.Debug("received V4 response", zap.Any("message", message)) if r, ok := respV4.Message.(*pbsubstreamsrpcv4.Response_BlockScopedDatas); ok { for idx, item := range r.BlockScopedDatas.Items { if activeCursor, receivedDataMessage, err = s.processBlockScopedData(ctx, handler, item, idx == 0, beforeReceive, &prevBlockTime, activeCursor); err != nil { - return activeCursor, receivedDataMessage, err + return activeCursor, receivedDataMessage, fmt.Errorf("processing block scoped data: %w", err) } afterReceive = time.Now() lastMessageWasData = true From 21a3d849cdeb9b802fa5dea596a0dd71c1de273b Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Mon, 16 Feb 2026 11:59:03 -0500 Subject: [PATCH 42/47] Add debug logging for `BlockScopedDatas` processing in Tier1 and sinker --- service/tier1.go | 1 + sink/sinker.go | 1 + 2 files changed, 2 insertions(+) diff --git a/service/tier1.go b/service/tier1.go index d41bf1165..17d6d552c 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -1111,6 +1111,7 @@ func tier1ResponseHandler( case *pbsubstreamsrpcv4.Response: for _, d := range r.GetBlockScopedDatas().Items { if d != nil { + isData = true filterData(d, noop, debugOutputs) } } diff --git a/sink/sinker.go b/sink/sinker.go index 5d2ef07a8..5493c1980 100644 --- a/sink/sinker.go +++ b/sink/sinker.go @@ -654,6 +654,7 @@ func (s *Sinker) doRequest( if respV4 != nil { s.Logger.Debug("received V4 response", zap.Any("message", message)) if r, ok := respV4.Message.(*pbsubstreamsrpcv4.Response_BlockScopedDatas); ok { + s.Logger.Debug("received block scoped data response", zap.Int("count", len(r.BlockScopedDatas.Items))) for idx, item := range r.BlockScopedDatas.Items { if activeCursor, receivedDataMessage, err = s.processBlockScopedData(ctx, handler, item, idx == 0, beforeReceive, &prevBlockTime, activeCursor); err != nil { return activeCursor, receivedDataMessage, fmt.Errorf("processing block scoped data: %w", err) From 470c8f0bafb015a27db596737ffa657e1dd6021a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Tue, 17 Feb 2026 12:09:47 -0500 Subject: [PATCH 43/47] fix typo --- orchestrator/execout/message_buffer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 4d19e5933..1f96c6cae 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -25,7 +25,7 @@ type MessageBuffer struct { } func NewMessageBuffer(maxBufferedMessage int, supportBuffer bool, logger *zap.Logger) *MessageBuffer { - maxDaraSize := 1024 * 1024 * 10 + maxDataSize := 1024 * 1024 * 10 maxDataSizeString := os.Getenv("MESSAGE_BUFFER_MAX_DATA_SIZE") if maxDataSizeString != "" { @@ -33,14 +33,14 @@ func NewMessageBuffer(maxBufferedMessage int, supportBuffer bool, logger *zap.Lo if err != nil { logger.Warn("failed to parse MESSAGE_BUFFER_MAX_DATA_SIZE, using default value", zap.Error(err)) } else { - maxDaraSize = parsed + maxDataSize = parsed } } return &MessageBuffer{ buf: &pbsubstreamsrpcv4.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}}, maxBufferedMessage: maxBufferedMessage, - maxDataSize: maxDaraSize, + maxDataSize: maxDataSize, supportBuffer: supportBuffer, logger: logger.Named("message-buffer"), } From dcf30cf4a7510e82cdfeca3673ef75d3ac0d717f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Tue, 17 Feb 2026 12:25:39 -0500 Subject: [PATCH 44/47] rename OutputBundleSize to OutputBufferSize, set default value --- app/tier1.go | 5 +++-- orchestrator/parallelprocessor.go | 4 ++-- pipeline/pipeline.go | 8 ++++---- service/tier1.go | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/tier1.go b/app/tier1.go index 93813c005..dc3201123 100644 --- a/app/tier1.go +++ b/app/tier1.go @@ -55,6 +55,7 @@ func NewDefaultTier1Config() *Tier1Config { MaxSubrequests: 10, StateBundleSize: 1000, BlockExecutionTimeout: 1 * time.Minute, + OutputBufferSize: 100, } } @@ -88,7 +89,7 @@ type Tier1Config struct { SubrequestsPlaintext bool SharedCacheSize uint64 - OutputBundleSize uint64 + OutputBufferSize uint64 // Used to bundle execout messages within 'BlockScopedDatas' when using protocol V4 WASMExtensions wasm.WASMExtensioner Tracing bool @@ -269,7 +270,7 @@ func (a *Tier1App) Run() error { a.config.ActiveRequestsSoftLimit, a.config.ActiveRequestsHardLimit, a.config.SharedCacheSize, - a.config.OutputBundleSize, + a.config.OutputBufferSize, a.modules.SessionPool, foundationalStoreEndpoints, opts..., diff --git a/orchestrator/parallelprocessor.go b/orchestrator/parallelprocessor.go index 005abac94..05bf396ef 100644 --- a/orchestrator/parallelprocessor.go +++ b/orchestrator/parallelprocessor.go @@ -33,7 +33,7 @@ func BuildParallelProcessor( respFunc func(resp substreams.ResponseFromAnyTier) error, storeConfigs store.ConfigMap, noopMode bool, - bufferSize int, + outputBufferSize int, supportBuffering bool, ) (*ParallelProcessor, error) { @@ -70,7 +70,7 @@ func BuildParallelProcessor( reqPlan.ReadExecOut, stream, noopMode, - bufferSize, + outputBufferSize, supportBuffering, ) } diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index 38cea2678..af531041e 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -136,7 +136,7 @@ type Pipeline struct { blockStepMap map[bstream.StepType]uint64 workerPoolFactory work.WorkerPoolFactory checkPendingShutdown func() bool - bufferSize int + outputBufferSize int supportBuffering bool } @@ -156,7 +156,7 @@ func New( executionTimeout time.Duration, checkPendingShutdown func() bool, foundationalEndpoints map[string]string, - bufferSize int, + outputBufferSize int, supportBuffering bool, opts ...Option, ) *Pipeline { @@ -183,7 +183,7 @@ func New( workerPoolFactory: workerPoolFactory, checkPendingShutdown: checkPendingShutdown, moduleNameToStage: make(map[string]int), - bufferSize: bufferSize, + outputBufferSize: outputBufferSize, supportBuffering: supportBuffering, } for _, opt := range opts { @@ -512,7 +512,7 @@ func (p *Pipeline) runParallelProcess(ctx context.Context, reqPlan *plan.Request p.respFunc, p.stores.configs, noopMode, - p.bufferSize, + p.outputBufferSize, p.supportBuffering, ) if err != nil { diff --git a/service/tier1.go b/service/tier1.go index 17d6d552c..d929a8d56 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -155,7 +155,7 @@ func NewTier1( activeRequestsSoftLimit int, activeRequestsHardLimit int, sharedCacheSize uint64, - outputBundleSize uint64, + outputBufferSize uint64, sessionPool dsession.SessionPool, foundationalEndpoints map[string]string, opts ...Option, @@ -213,7 +213,7 @@ func NewTier1( foundationalEndpoints: foundationalEndpoints, sessionPool: sessionPool, activeRequestsManager: active_requests.NewActiveRequestsManager(logger), - execOutMessageBufferSize: int(outputBundleSize), + execOutMessageBufferSize: int(outputBufferSize), } s.OnTerminating(func(_ error) { s.activeRequestsWG.Wait() From f4428c73d189feda2e312862b719d93c8f4574a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Tue, 17 Feb 2026 12:31:37 -0500 Subject: [PATCH 45/47] simplify outputBuffer management when disabled --- orchestrator/execout/execout_walker.go | 8 ++++++- orchestrator/execout/message_buffer.go | 29 ++++---------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/orchestrator/execout/execout_walker.go b/orchestrator/execout/execout_walker.go index 6eaf9889c..a003c8608 100644 --- a/orchestrator/execout/execout_walker.go +++ b/orchestrator/execout/execout_walker.go @@ -47,6 +47,12 @@ func NewWalker( supportBuffering bool, ) *Walker { logger := reqctx.Logger(ctx).Named("execout_walker") + + var buffer *MessageBuffer + if supportBuffering { + buffer = NewMessageBuffer(bufferSize, logger) + } + return &Walker{ ctx: ctx, module: module, @@ -55,7 +61,7 @@ func NewWalker( streamOut: stream, noopMode: noopMode, logger: logger, - buffer: NewMessageBuffer(bufferSize, supportBuffering, logger), + buffer: buffer, supportBuffering: supportBuffering, } } diff --git a/orchestrator/execout/message_buffer.go b/orchestrator/execout/message_buffer.go index 1f96c6cae..447e110fd 100644 --- a/orchestrator/execout/message_buffer.go +++ b/orchestrator/execout/message_buffer.go @@ -21,10 +21,9 @@ type MessageBuffer struct { DataSize int logger *zap.Logger maxDataSize int - supportBuffer bool } -func NewMessageBuffer(maxBufferedMessage int, supportBuffer bool, logger *zap.Logger) *MessageBuffer { +func NewMessageBuffer(maxBufferedMessage int, logger *zap.Logger) *MessageBuffer { maxDataSize := 1024 * 1024 * 10 maxDataSizeString := os.Getenv("MESSAGE_BUFFER_MAX_DATA_SIZE") @@ -41,7 +40,6 @@ func NewMessageBuffer(maxBufferedMessage int, supportBuffer bool, logger *zap.Lo buf: &pbsubstreamsrpcv4.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{}}, maxBufferedMessage: maxBufferedMessage, maxDataSize: maxDataSize, - supportBuffer: supportBuffer, logger: logger.Named("message-buffer"), } } @@ -81,28 +79,9 @@ func (b *MessageBuffer) Flush(streamSrv *response.Stream) error { b.mut.Lock() defer b.mut.Unlock() - if b.maxBufferedMessage < 2 { - for _, msg := range b.buf.Items { - if b.supportBuffer { //this is looking weird but if a v4 request is running the support of BlockScopedData has been removed - d := &pbsubstreamsrpcv4.BlockScopedDatas{Items: []*pbsubstreamsrpcv2.BlockScopedData{ - msg, - }} - err := streamSrv.BlockScopedDatas(d) - if err != nil { - return fmt.Errorf("flushing buffer: %w", err) - } - } else { - err := streamSrv.BlockScopedData(msg) - if err != nil { - return fmt.Errorf("flushing single block scope data: %w", err) - } - } - } - } else { - err := streamSrv.BlockScopedDatas(b.buf) - if err != nil { - return fmt.Errorf("flushing buffer: %w", err) - } + err := streamSrv.BlockScopedDatas(b.buf) + if err != nil { + return fmt.Errorf("flushing buffer: %w", err) } b.lastFlush = time.Now() From 03431c381f63cb2499cb98f2505a9ae28b821f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Tue, 17 Feb 2026 12:38:04 -0500 Subject: [PATCH 46/47] clean up dead code, complete error handlers for completeness --- service/error.go | 25 +++++++++++++++++++++++-- service/tier1.go | 15 --------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/service/error.go b/service/error.go index f4d1d8b20..51520e470 100644 --- a/service/error.go +++ b/service/error.go @@ -64,13 +64,34 @@ func toConnectError(ctx context.Context, err error) error { case codes.InvalidArgument: return connect.NewError(connect.CodeInvalidArgument, errors.New(grpcError.Message())) case codes.DeadlineExceeded: - return connect.NewError(connect.CodeDeadlineExceeded, err) + return connect.NewError(connect.CodeDeadlineExceeded, errors.New(grpcError.Message())) case codes.ResourceExhausted: return connect.NewError(connect.CodeResourceExhausted, errors.New(grpcError.Message())) + case codes.FailedPrecondition: + return connect.NewError(connect.CodeFailedPrecondition, errors.New(grpcError.Message())) + case codes.Aborted: + return connect.NewError(connect.CodeAborted, errors.New(grpcError.Message())) + case codes.OutOfRange: + return connect.NewError(connect.CodeOutOfRange, errors.New(grpcError.Message())) + case codes.Unimplemented: + return connect.NewError(connect.CodeUnimplemented, errors.New(grpcError.Message())) + case codes.Internal: + return connect.NewError(connect.CodeInternal, errors.New(grpcError.Message())) case codes.Unknown: return connect.NewError(connect.CodeUnknown, errors.New(grpcError.Message())) + case codes.NotFound: + return connect.NewError(connect.CodeNotFound, errors.New(grpcError.Message())) + case codes.AlreadyExists: + return connect.NewError(connect.CodeAlreadyExists, errors.New(grpcError.Message())) + case codes.PermissionDenied: + return connect.NewError(connect.CodePermissionDenied, errors.New(grpcError.Message())) + case codes.Unauthenticated: + return connect.NewError(connect.CodeUnauthenticated, errors.New(grpcError.Message())) + case codes.DataLoss: + return connect.NewError(connect.CodeDataLoss, errors.New(grpcError.Message())) + default: + return connect.NewError(connect.CodeUnknown, errors.New(grpcError.Message())) } - return grpcError.Err() } // special case for "QuickSave" on shutdown diff --git a/service/tier1.go b/service/tier1.go index d929a8d56..fa9b3858f 100644 --- a/service/tier1.go +++ b/service/tier1.go @@ -548,21 +548,6 @@ func (s *Tier1Service) BlocksAny( return runningContext, nil, nil } -func compressorsFromHeader(header http.Header) (out map[string]bool) { - out = make(map[string]bool) - for k, v := range header { - petitK := strings.ToLower(k) - if petitK == "grpc-accept-encoding" || petitK == "connect-accept-encoding" || petitK == "accept-encoding" { - for _, vv := range v { - for _, vvv := range strings.Split(vv, ",") { - out[strings.ToLower(vvv)] = true - } - } - } - } - return -} - // writePackage writes the spkg to the module cache if it doesn't exist: // - `substreams.spkg.zst` if it comes from a substreams.rpc.v3 request (package is complete with metadata) // - `substreams.partial.spkg.zst` if it comes from a substreams.rpc.v2 request (package is partial, missing protobuf definitions and other metadata) From 01853e94e66defffdecb77ab56cf0dda288ece38 Mon Sep 17 00:00:00 2001 From: Charles Billette Date: Wed, 18 Feb 2026 11:50:49 -0500 Subject: [PATCH 47/47] Update `dgrpc` dependency and refactor gRPC request handling in `server.go` --- go.mod | 2 +- go.sum | 4 ++-- service/server.go | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index fbaa535a1..7c8964e94 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/streamingfast/dauth v0.0.0-20251218134044-fb716c7172b4 github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 - github.com/streamingfast/dgrpc v0.0.0-20260213162824-8daf6d0a5775 + github.com/streamingfast/dgrpc v0.0.0-20260218164858-719a69f1b7b4 github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 github.com/streamingfast/dstore v0.1.3-0.20260113210117-94d66eda2027 github.com/streamingfast/logging v0.0.0-20260108192805-38f96de0a641 diff --git a/go.sum b/go.sum index 82ddf76b2..89c010770 100644 --- a/go.sum +++ b/go.sum @@ -559,8 +559,8 @@ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c h1:6WjE2yInE+ github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c/go.mod h1:dbfiy9ORrL8c6ldSq+L0H9pg8TOqqu/FsghsgUEWK54= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7 h1:KeyhmbdPhEzot+On1XrHSAOmRoeyIRiM0EkGQAqnVxI= github.com/streamingfast/derr v0.0.0-20250814163534-bd7407bd89d7/go.mod h1:QSm/AfaDsE0k1xBYi0lW580YJ/WDV/FKZI628tkZR0Y= -github.com/streamingfast/dgrpc v0.0.0-20260213162824-8daf6d0a5775 h1:tYX0K+6n5Jjl8wxczjUANVsmrIYv9E2yz6ERCRDmOeo= -github.com/streamingfast/dgrpc v0.0.0-20260213162824-8daf6d0a5775/go.mod h1:S6lJ9Dd6M3myzWbxspuhGggHtld9uYVN0xQ/7EGXmX8= +github.com/streamingfast/dgrpc v0.0.0-20260218164858-719a69f1b7b4 h1:C4WiIoGrI3QJzAe4Gcye5L0avOm0lB4yQtk28E0OvNc= +github.com/streamingfast/dgrpc v0.0.0-20260218164858-719a69f1b7b4/go.mod h1:S6lJ9Dd6M3myzWbxspuhGggHtld9uYVN0xQ/7EGXmX8= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2 h1:/mcLVdwy6NeHWfJwuh2GD4+FMfPa59fkfM15sl8Jejk= github.com/streamingfast/dhammer v0.0.0-20220506192416-3797a7906da2/go.mod h1:MyG3U4ABuf7ANS8tix+e8UUevN7B9juhEnAbslS/X3M= github.com/streamingfast/dhttp v0.1.3-0.20251218140957-6d46b8f12eb1 h1:V9oSpY69/OZKTptZEPzJFaC8RS0Y8kffknNTDSZwpME= diff --git a/service/server.go b/service/server.go index 456e7e304..3c3169104 100644 --- a/service/server.go +++ b/service/server.go @@ -53,12 +53,10 @@ func ListenTier1( contentType := r.Header.Get("Content-Type") logger.Info("handling request", zap.String("content-type", contentType)) - if strings.HasPrefix(contentType, "application/grpc") || strings.HasPrefix(contentType, "application/grpc-web") { - logger.Debug("forwarding gRPC request") - grpcServer.ServeHTTP(w, r) - - return - } + //if strings.HasPrefix(contentType, "application/grpc") || strings.HasPrefix(contentType, "application/grpc-web") { + // + // return + //} if strings.HasPrefix(contentType, "application/connect") || contentType == "application/json" || strings.Contains(contentType, "json") { // loose match for safety logger.Debug("forwarding gRPC-Web request") connectServer.ServeHTTP(w, r) @@ -66,7 +64,10 @@ func ListenTier1( } - http.Error(w, "Unsupported Content-Type for RPC", http.StatusUnsupportedMediaType) + logger.Debug("forwarding gRPC request") + grpcServer.ServeHTTP(w, r) + + //http.Error(w, "Unsupported Content-Type for RPC", http.StatusUnsupportedMediaType) }) compressionHandler := standard.CompressionHandler(enforceCompression, mux)