From 7bfba4ccea6734eec2429a27f909022a12c58e37 Mon Sep 17 00:00:00 2001 From: miiu Date: Sun, 5 Apr 2026 09:44:33 +0300 Subject: [PATCH 1/9] grpc driver --- cmd/node/config/external.toml | 6 + config/externalConfig.go | 7 ++ factory/status/statusComponents.go | 28 +++++ go.mod | 39 +++--- go.sum | 86 +++++++------ node/chainSimulator/chainSimulator_test.go | 2 +- .../components/statusComponents.go | 28 +++++ outport/factory/outportFactory.go | 38 ++++++ outport/grpc/grpcDriver.go | 117 ++++++++++++++++++ 9 files changed, 294 insertions(+), 57 deletions(-) create mode 100644 outport/grpc/grpcDriver.go diff --git a/cmd/node/config/external.toml b/cmd/node/config/external.toml index b5e11f73646..3acff61da2d 100644 --- a/cmd/node/config/external.toml +++ b/cmd/node/config/external.toml @@ -42,6 +42,12 @@ # marshalled structures in block events data MarshallerType = "json" +[[GRPCDriversConfig]] + Enabled = true + URL = "localhost:50051" + MarshallerType = "json" + + [[HostDriversConfig]] # This flag shall only be used for observer nodes Enabled = false diff --git a/config/externalConfig.go b/config/externalConfig.go index 9fea75b5024..07dda04728e 100644 --- a/config/externalConfig.go +++ b/config/externalConfig.go @@ -5,6 +5,7 @@ type ExternalConfig struct { ElasticSearchConnector ElasticSearchConfig EventNotifierConnector EventNotifierConfig HostDriversConfig []HostDriversConfig + GRPCDriversConfig []GRPCDriversConfig } // ElasticSearchConfig will hold the configuration for the elastic search @@ -51,3 +52,9 @@ type HostDriversConfig struct { AcknowledgeTimeoutInSec int Version uint32 } + +type GRPCDriversConfig struct { + Enabled bool + URL string + MarshallerType string +} diff --git a/factory/status/statusComponents.go b/factory/status/statusComponents.go index 2d2d3fab527..758d4628420 100644 --- a/factory/status/statusComponents.go +++ b/factory/status/statusComponents.go @@ -222,12 +222,18 @@ func (scf *statusComponentsFactory) createOutportDriver() (outport.OutportHandle return nil, err } + grpcDriverArgs, err := scf.makeGRPCDriversArgs() + if err != nil { + return nil, err + } + outportFactoryArgs := &outportDriverFactory.OutportFactoryArgs{ ShardID: scf.shardCoordinator.SelfId(), RetrialInterval: common.RetrialIntervalForOutportDriver, ElasticIndexerFactoryArgs: scf.makeElasticIndexerArgs(), EventNotifierFactoryArgs: eventNotifierArgs, HostDriversArgs: hostDriversArgs, + GRPCDriversArgs: grpcDriverArgs, IsImportDB: scf.isInImportMode, EnableEpochsHandler: scf.coreComponents.EnableEpochsHandler(), EnableRoundsHandler: scf.coreComponents.EnableRoundsHandler(), @@ -295,3 +301,25 @@ func (scf *statusComponentsFactory) makeHostDriversArgs() ([]outportDriverFactor return argsHostDriverFactorySlice, nil } + +func (scf *statusComponentsFactory) makeGRPCDriversArgs() ([]outportDriverFactory.ArgsGRPCDriverFactory, error) { + argsHostDriverFactorySlice := make([]outportDriverFactory.ArgsGRPCDriverFactory, 0, len(scf.externalConfig.GRPCDriversConfig)) + for idx := 0; idx < len(scf.externalConfig.GRPCDriversConfig); idx++ { + grpcConfig := scf.externalConfig.GRPCDriversConfig[idx] + if !grpcConfig.Enabled { + continue + } + + marshaller, err := factoryMarshalizer.NewMarshalizer(grpcConfig.MarshallerType) + if err != nil { + return argsHostDriverFactorySlice, err + } + + argsHostDriverFactorySlice = append(argsHostDriverFactorySlice, outportDriverFactory.ArgsGRPCDriverFactory{ + Marshaller: marshaller, + GRPCClient: grpcConfig, + }) + } + + return argsHostDriverFactorySlice, nil +} diff --git a/go.mod b/go.mod index a8ac7fe289a..dfad798722e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/multiversx/mx-chain-go -go 1.23.0 +go 1.24.0 require ( github.com/beevik/ntp v1.3.0 @@ -17,7 +17,7 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.13.0 github.com/mitchellh/mapstructure v1.5.0 github.com/multiversx/mx-chain-communication-go v1.3.1 - github.com/multiversx/mx-chain-core-go v1.5.0 + github.com/multiversx/mx-chain-core-go v1.5.1-0.20260403192013-73793e2d03c0 github.com/multiversx/mx-chain-crypto-go v1.3.1 github.com/multiversx/mx-chain-es-indexer-go v1.10.2 github.com/multiversx/mx-chain-logger-go v1.1.0 @@ -32,11 +32,11 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.20.5 github.com/shirou/gopsutil v3.21.11+incompatible - github.com/stretchr/testify v1.10.0 + github.com/stretchr/testify v1.11.1 github.com/urfave/cli v1.22.16 - golang.org/x/crypto v0.35.0 + golang.org/x/crypto v0.47.0 golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c - golang.org/x/sync v0.11.0 + golang.org/x/sync v0.19.0 gopkg.in/go-playground/validator.v8 v8.18.2 ) @@ -66,7 +66,7 @@ require ( github.com/francoispqt/gojay v1.2.13 // indirect github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-playground/locales v0.14.1 // indirect @@ -75,7 +75,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect @@ -185,23 +185,26 @@ require ( github.com/wlynxg/anet v0.0.5 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel v1.34.0 // indirect - go.opentelemetry.io/otel/metric v1.34.0 // indirect - go.opentelemetry.io/otel/trace v1.34.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.39.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/trace v1.39.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/text v0.22.0 // indirect - golang.org/x/tools v0.29.0 // indirect - gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/protobuf v1.36.4 // indirect + golang.org/x/mod v0.31.0 // indirect + golang.org/x/net v0.49.0 // indirect + golang.org/x/sys v0.40.0 // indirect + golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc // indirect + golang.org/x/text v0.33.0 // indirect + golang.org/x/tools v0.40.0 // indirect + gonum.org/v1/gonum v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect + google.golang.org/grpc v1.80.0 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.3.0 // indirect diff --git a/go.sum b/go.sum index 9769db75310..983e54b89f5 100644 --- a/go.sum +++ b/go.sum @@ -135,8 +135,8 @@ github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmy github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= @@ -184,8 +184,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -197,8 +197,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -401,8 +401,8 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o= github.com/multiversx/mx-chain-communication-go v1.3.1 h1:rJj4FOTqacD+yaAfz61FoEtwpAYmOQFyLEHdy1YZya4= github.com/multiversx/mx-chain-communication-go v1.3.1/go.mod h1:gDVWn6zUW6aCN1YOm/FbbT5MUmhgn/L1Rmpl8EoH3Yg= -github.com/multiversx/mx-chain-core-go v1.5.0 h1:YBxTsxBGd4hy9A3plcILu+jDy4BcQaD8oyVRDC1tz8A= -github.com/multiversx/mx-chain-core-go v1.5.0/go.mod h1:IO+vspNan+gT0WOHnJ95uvWygiziHZvfXpff6KnxV7g= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260403192013-73793e2d03c0 h1:J8F+jMyejsvSUZxehazKAjMJ+By2V2Yy8EZ7UzBArU8= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260403192013-73793e2d03c0/go.mod h1:3XR9EeZz9U5fSrEFLR3NyHOCa7tpdBs6C04ZA/rutEY= github.com/multiversx/mx-chain-crypto-go v1.3.1 h1:tCoGkfiv0wz97kuW6AZPW4RVL0Yp7PBo8NKQj9f2oh4= github.com/multiversx/mx-chain-crypto-go v1.3.1/go.mod h1:nPIkxxzyTP8IquWKds+22Q2OJ9W7LtusC7cAosz7ojM= github.com/multiversx/mx-chain-es-indexer-go v1.10.2 h1:mLFRUpZ2bWeYplU1e0kb318kk1x7AV9owq5B4XRdOqE= @@ -542,8 +542,8 @@ github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtD github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -602,8 +602,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -648,14 +648,18 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= -go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= -go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= -go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= -go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= -go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= @@ -697,8 +701,8 @@ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= +golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= @@ -714,8 +718,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= +golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -745,8 +749,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -761,8 +765,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -803,8 +807,10 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= +golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc h1:bH6xUXay0AIFMElXG2rQ4uiE+7ncwtiOdPfYK1NK2XA= +golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -824,8 +830,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -848,15 +854,15 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= -golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= +golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= -gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -871,6 +877,8 @@ google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 h1:sNrWoksmOyF5bvJUcnmbeAmQi8baNhqg5IWaI3llQqU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -879,6 +887,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= +google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -891,8 +901,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= -google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +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= diff --git a/node/chainSimulator/chainSimulator_test.go b/node/chainSimulator/chainSimulator_test.go index 45b656d9ca0..110175c5bab 100644 --- a/node/chainSimulator/chainSimulator_test.go +++ b/node/chainSimulator/chainSimulator_test.go @@ -62,7 +62,7 @@ func TestChainSimulatorCheckSupernova(t *testing.T) { MinNodesPerShard: 3, MetaChainMinNodes: 3, AlterConfigsFunction: func(cfg *config.Configs) { - + cfg.ExternalConfig.GRPCDriversConfig[0].Enabled = true }, }) require.Nil(t, err) diff --git a/node/chainSimulator/components/statusComponents.go b/node/chainSimulator/components/statusComponents.go index 4b3f5bb6de1..b817d3c5bcb 100644 --- a/node/chainSimulator/components/statusComponents.go +++ b/node/chainSimulator/components/statusComponents.go @@ -58,11 +58,17 @@ func CreateStatusComponents(shardID uint32, appStatusHandler core.AppStatusHandl if err != nil { return nil, err } + grpcDriversArgs, err := makeGRPCDriversArgs(external) + if err != nil { + return nil, err + } + instance.outportHandler, err = outportFactory.CreateOutport(&outportFactory.OutportFactoryArgs{ IsImportDB: false, ShardID: shardID, RetrialInterval: time.Second, HostDriversArgs: hostDriverArgs, + GRPCDriversArgs: grpcDriversArgs, EventNotifierFactoryArgs: &outportFactory.EventNotifierFactoryArgs{}, ElasticIndexerFactoryArgs: makeElasticIndexerArgs(external, coreComponents), EnableEpochsHandler: coreComponents.EnableEpochsHandler(), @@ -111,6 +117,28 @@ func (s *statusComponentsHolder) epochStartEventHandler() epochStart.ActionHandl return subscribeHandler } +func makeGRPCDriversArgs(external config.ExternalConfig) ([]outportFactory.ArgsGRPCDriverFactory, error) { + argsGRPCDriverFactorySlice := make([]outportFactory.ArgsGRPCDriverFactory, 0, len(external.GRPCDriversConfig)) + for idx := 0; idx < len(external.GRPCDriversConfig); idx++ { + grpcConfig := external.GRPCDriversConfig[idx] + if !grpcConfig.Enabled { + continue + } + + marshaller, err := factoryMarshalizer.NewMarshalizer(grpcConfig.MarshallerType) + if err != nil { + return argsGRPCDriverFactorySlice, err + } + + argsGRPCDriverFactorySlice = append(argsGRPCDriverFactorySlice, outportFactory.ArgsGRPCDriverFactory{ + Marshaller: marshaller, + GRPCClient: grpcConfig, + }) + } + + return argsGRPCDriverFactorySlice, nil +} + func makeHostDriversArgs(external config.ExternalConfig) ([]outportFactory.ArgsHostDriverFactory, error) { argsHostDriverFactorySlice := make([]outportFactory.ArgsHostDriverFactory, 0, len(external.HostDriversConfig)) for idx := 0; idx < len(external.HostDriversConfig); idx++ { diff --git a/outport/factory/outportFactory.go b/outport/factory/outportFactory.go index 64c5671737d..3302e7bd8c6 100644 --- a/outport/factory/outportFactory.go +++ b/outport/factory/outportFactory.go @@ -5,9 +5,13 @@ import ( "time" outportcore "github.com/multiversx/mx-chain-core-go/data/outport" + "github.com/multiversx/mx-chain-core-go/data/outport/grpc" + "github.com/multiversx/mx-chain-core-go/marshal" indexerFactory "github.com/multiversx/mx-chain-es-indexer-go/process/factory" "github.com/multiversx/mx-chain-go/common" + "github.com/multiversx/mx-chain-go/config" "github.com/multiversx/mx-chain-go/outport" + grpc2 "github.com/multiversx/mx-chain-go/outport/grpc" ) // OutportFactoryArgs holds the factory arguments of different outport drivers @@ -18,6 +22,7 @@ type OutportFactoryArgs struct { ElasticIndexerFactoryArgs indexerFactory.ArgsIndexerFactory EventNotifierFactoryArgs *EventNotifierFactoryArgs HostDriversArgs []ArgsHostDriverFactory + GRPCDriversArgs []ArgsGRPCDriverFactory EnableEpochsHandler common.EnableEpochsHandler EnableRoundsHandler common.EnableRoundsHandler } @@ -70,6 +75,13 @@ func createAndSubscribeDrivers(outport outport.OutportHandler, args *OutportFact } } + for idx := 0; idx < len(args.GRPCDriversArgs); idx++ { + err = createAndSubscribeGRPCDriverIfNeeded(outport, args.GRPCDriversArgs[idx]) + if err != nil { + return fmt.Errorf("%w when calling createAndSubscribeGRPCDriverIfNeeded, grpc driver index %d", err, idx) + } + } + return nil } @@ -128,3 +140,29 @@ func createAndSubscribeHostDriverIfNeeded( return outport.SubscribeDriver(hostDriver) } + +type ArgsGRPCDriverFactory struct { + GRPCClient config.GRPCDriversConfig + Marshaller marshal.Marshalizer +} + +func createAndSubscribeGRPCDriverIfNeeded( + outport outport.OutportHandler, + args ArgsGRPCDriverFactory, +) error { + if !args.GRPCClient.Enabled { + return nil + } + + grpcClient, err := grpc.NewOutportGRPCClient(args.GRPCClient.URL) + if err != nil { + return err + } + + grpcDriver, err := grpc2.NewGRPCDriver(grpcClient, args.Marshaller) + if err != nil { + return err + } + + return outport.SubscribeDriver(grpcDriver) +} diff --git a/outport/grpc/grpcDriver.go b/outport/grpc/grpcDriver.go new file mode 100644 index 00000000000..2591e13d853 --- /dev/null +++ b/outport/grpc/grpcDriver.go @@ -0,0 +1,117 @@ +package grpc + +import ( + "context" + "time" + + outportcore "github.com/multiversx/mx-chain-core-go/data/outport" + "github.com/multiversx/mx-chain-core-go/data/outport/grpc" + "github.com/multiversx/mx-chain-core-go/marshal" + "github.com/multiversx/mx-chain-go/outport" + logger "github.com/multiversx/mx-chain-logger-go" +) + +var log = logger.GetOrCreate("grpcDriver") + +type grpcDriver struct { + client grpc.OutportClient + marshaller marshal.Marshalizer +} + +func NewGRPCDriver(client grpc.OutportClient, marshaller marshal.Marshalizer) (outport.Driver, error) { + return &grpcDriver{ + client: client, + marshaller: marshaller, + }, nil +} + +func (g *grpcDriver) SaveBlock(outportBlock *outportcore.OutportBlock) error { + response, err := g.client.SaveBlock(context.Background(), outportBlock) + if err != nil { + return err + } + + d := time.Duration(response.IndexingTimeInMs) * time.Millisecond + log.Warn("grpcDriver.SaveBlock", "shardID", outportBlock.ShardID, "duration", d) + return nil +} + +func (g *grpcDriver) RevertIndexedBlock(blockData *outportcore.BlockData) error { + response, err := g.client.RevertIndexedBlock(context.Background(), blockData) + if err != nil { + return err + } + + log.Debug("grpcDriver.RevertIndexedBlock", "duration", response.IndexingTimeInMs) + return nil +} + +func (g *grpcDriver) SaveRoundsInfo(roundsInfos *outportcore.RoundsInfo) error { + response, err := g.client.SaveRoundsInfo(context.Background(), roundsInfos) + if err != nil { + return err + } + + log.Debug("grpcDriver.SaveRoundsInfo", "duration", response.IndexingTimeInMs) + return nil +} + +func (g *grpcDriver) SaveValidatorsPubKeys(validatorsPubKeys *outportcore.ValidatorsPubKeys) error { + response, err := g.client.SaveValidatorsPubKeys(context.Background(), validatorsPubKeys) + if err != nil { + return err + } + + log.Debug("grpcDriver.SaveValidatorsPubKeys", "duration", response.IndexingTimeInMs) + return nil +} + +func (g *grpcDriver) SaveValidatorsRating(validatorsRating *outportcore.ValidatorsRating) error { + response, err := g.client.SaveValidatorsRating(context.Background(), validatorsRating) + if err != nil { + return err + } + + log.Debug("grpcDriver.SaveValidatorsRating", "duration", response.IndexingTimeInMs) + return nil +} + +func (g *grpcDriver) SaveAccounts(accounts *outportcore.Accounts) error { + response, err := g.client.SaveAccounts(context.Background(), accounts) + if err != nil { + return err + } + + log.Debug("grpcDriver.SaveAccounts", "duration", response.IndexingTimeInMs) + return nil +} + +func (g *grpcDriver) FinalizedBlock(finalizedBlock *outportcore.FinalizedBlock) error { + response, err := g.client.FinalizedBlockEvent(context.Background(), finalizedBlock) + if err != nil { + return err + } + + log.Debug("grpcDriver.FinalizedBlock", "duration", response.IndexingTimeInMs) + return nil +} + +func (g *grpcDriver) GetMarshaller() marshal.Marshalizer { + return g.marshaller +} + +func (g *grpcDriver) SetCurrentSettings(_ outportcore.OutportConfig) error { + return nil +} + +func (g *grpcDriver) RegisterHandler(_ func() error, _ string) error { + return nil +} + +func (g *grpcDriver) Close() error { + return nil +} + +func (g *grpcDriver) IsInterfaceNil() bool { + return g == nil +} From a1ace8e369467725f1237148fcae08173863d5f3 Mon Sep 17 00:00:00 2001 From: miiu Date: Mon, 6 Apr 2026 11:20:09 +0300 Subject: [PATCH 2/9] changed package name --- go.mod | 2 +- go.sum | 4 ++-- outport/factory/outportFactory.go | 4 ++-- outport/grpc/grpcDriver.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index dfad798722e..c5d9fff2bcb 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.13.0 github.com/mitchellh/mapstructure v1.5.0 github.com/multiversx/mx-chain-communication-go v1.3.1 - github.com/multiversx/mx-chain-core-go v1.5.1-0.20260403192013-73793e2d03c0 + github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406081004-63788a1efea9 github.com/multiversx/mx-chain-crypto-go v1.3.1 github.com/multiversx/mx-chain-es-indexer-go v1.10.2 github.com/multiversx/mx-chain-logger-go v1.1.0 diff --git a/go.sum b/go.sum index 983e54b89f5..dea66787023 100644 --- a/go.sum +++ b/go.sum @@ -401,8 +401,8 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o= github.com/multiversx/mx-chain-communication-go v1.3.1 h1:rJj4FOTqacD+yaAfz61FoEtwpAYmOQFyLEHdy1YZya4= github.com/multiversx/mx-chain-communication-go v1.3.1/go.mod h1:gDVWn6zUW6aCN1YOm/FbbT5MUmhgn/L1Rmpl8EoH3Yg= -github.com/multiversx/mx-chain-core-go v1.5.1-0.20260403192013-73793e2d03c0 h1:J8F+jMyejsvSUZxehazKAjMJ+By2V2Yy8EZ7UzBArU8= -github.com/multiversx/mx-chain-core-go v1.5.1-0.20260403192013-73793e2d03c0/go.mod h1:3XR9EeZz9U5fSrEFLR3NyHOCa7tpdBs6C04ZA/rutEY= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406081004-63788a1efea9 h1:r44hNew48SVJBHPt5QxobaWqI5usuxsHGxhvttePHIE= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406081004-63788a1efea9/go.mod h1:3XR9EeZz9U5fSrEFLR3NyHOCa7tpdBs6C04ZA/rutEY= github.com/multiversx/mx-chain-crypto-go v1.3.1 h1:tCoGkfiv0wz97kuW6AZPW4RVL0Yp7PBo8NKQj9f2oh4= github.com/multiversx/mx-chain-crypto-go v1.3.1/go.mod h1:nPIkxxzyTP8IquWKds+22Q2OJ9W7LtusC7cAosz7ojM= github.com/multiversx/mx-chain-es-indexer-go v1.10.2 h1:mLFRUpZ2bWeYplU1e0kb318kk1x7AV9owq5B4XRdOqE= diff --git a/outport/factory/outportFactory.go b/outport/factory/outportFactory.go index 3302e7bd8c6..c72b15a07f0 100644 --- a/outport/factory/outportFactory.go +++ b/outport/factory/outportFactory.go @@ -5,7 +5,7 @@ import ( "time" outportcore "github.com/multiversx/mx-chain-core-go/data/outport" - "github.com/multiversx/mx-chain-core-go/data/outport/grpc" + "github.com/multiversx/mx-chain-core-go/data/outport/grpcadapter" "github.com/multiversx/mx-chain-core-go/marshal" indexerFactory "github.com/multiversx/mx-chain-es-indexer-go/process/factory" "github.com/multiversx/mx-chain-go/common" @@ -154,7 +154,7 @@ func createAndSubscribeGRPCDriverIfNeeded( return nil } - grpcClient, err := grpc.NewOutportGRPCClient(args.GRPCClient.URL) + grpcClient, err := grpcadapter.NewOutportGRPCClient(args.GRPCClient.URL) if err != nil { return err } diff --git a/outport/grpc/grpcDriver.go b/outport/grpc/grpcDriver.go index 2591e13d853..93d931eab31 100644 --- a/outport/grpc/grpcDriver.go +++ b/outport/grpc/grpcDriver.go @@ -5,7 +5,7 @@ import ( "time" outportcore "github.com/multiversx/mx-chain-core-go/data/outport" - "github.com/multiversx/mx-chain-core-go/data/outport/grpc" + "github.com/multiversx/mx-chain-core-go/data/outport/grpcadapter" "github.com/multiversx/mx-chain-core-go/marshal" "github.com/multiversx/mx-chain-go/outport" logger "github.com/multiversx/mx-chain-logger-go" @@ -14,11 +14,11 @@ import ( var log = logger.GetOrCreate("grpcDriver") type grpcDriver struct { - client grpc.OutportClient + client grpcadapter.OutportClient marshaller marshal.Marshalizer } -func NewGRPCDriver(client grpc.OutportClient, marshaller marshal.Marshalizer) (outport.Driver, error) { +func NewGRPCDriver(client grpcadapter.OutportClient, marshaller marshal.Marshalizer) (outport.Driver, error) { return &grpcDriver{ client: client, marshaller: marshaller, From 1dafb503675b9f3166183cdd3f08ff8421700294 Mon Sep 17 00:00:00 2001 From: miiu Date: Mon, 6 Apr 2026 11:40:56 +0300 Subject: [PATCH 3/9] disable --- go.mod | 4 ++-- go.sum | 4 ++-- node/chainSimulator/chainSimulator_test.go | 6 ++--- outport/factory/outportFactory.go | 28 +++++++++++++++++++--- outport/{grpc => grpcdriver}/grpcDriver.go | 25 +++++++------------ 5 files changed, 40 insertions(+), 27 deletions(-) rename outport/{grpc => grpcdriver}/grpcDriver.go (61%) diff --git a/go.mod b/go.mod index c5d9fff2bcb..d148e4f05e4 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.13.0 github.com/mitchellh/mapstructure v1.5.0 github.com/multiversx/mx-chain-communication-go v1.3.1 - github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406081004-63788a1efea9 + github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406083524-92a09acbba29 github.com/multiversx/mx-chain-crypto-go v1.3.1 github.com/multiversx/mx-chain-es-indexer-go v1.10.2 github.com/multiversx/mx-chain-logger-go v1.1.0 @@ -37,6 +37,7 @@ require ( golang.org/x/crypto v0.47.0 golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c golang.org/x/sync v0.19.0 + google.golang.org/grpc v1.80.0 gopkg.in/go-playground/validator.v8 v8.18.2 ) @@ -203,7 +204,6 @@ require ( golang.org/x/tools v0.40.0 // indirect gonum.org/v1/gonum v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect - google.golang.org/grpc v1.80.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index dea66787023..bdc77ce4314 100644 --- a/go.sum +++ b/go.sum @@ -401,8 +401,8 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o= github.com/multiversx/mx-chain-communication-go v1.3.1 h1:rJj4FOTqacD+yaAfz61FoEtwpAYmOQFyLEHdy1YZya4= github.com/multiversx/mx-chain-communication-go v1.3.1/go.mod h1:gDVWn6zUW6aCN1YOm/FbbT5MUmhgn/L1Rmpl8EoH3Yg= -github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406081004-63788a1efea9 h1:r44hNew48SVJBHPt5QxobaWqI5usuxsHGxhvttePHIE= -github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406081004-63788a1efea9/go.mod h1:3XR9EeZz9U5fSrEFLR3NyHOCa7tpdBs6C04ZA/rutEY= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406083524-92a09acbba29 h1:kAwTgXEgYieGpGg0ul9OQaHDFuGIdovDN4TPF11JdpQ= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406083524-92a09acbba29/go.mod h1:3XR9EeZz9U5fSrEFLR3NyHOCa7tpdBs6C04ZA/rutEY= github.com/multiversx/mx-chain-crypto-go v1.3.1 h1:tCoGkfiv0wz97kuW6AZPW4RVL0Yp7PBo8NKQj9f2oh4= github.com/multiversx/mx-chain-crypto-go v1.3.1/go.mod h1:nPIkxxzyTP8IquWKds+22Q2OJ9W7LtusC7cAosz7ojM= github.com/multiversx/mx-chain-es-indexer-go v1.10.2 h1:mLFRUpZ2bWeYplU1e0kb318kk1x7AV9owq5B4XRdOqE= diff --git a/node/chainSimulator/chainSimulator_test.go b/node/chainSimulator/chainSimulator_test.go index 110175c5bab..866e24c0f9c 100644 --- a/node/chainSimulator/chainSimulator_test.go +++ b/node/chainSimulator/chainSimulator_test.go @@ -61,9 +61,9 @@ func TestChainSimulatorCheckSupernova(t *testing.T) { ApiInterface: api.NewNoApiInterface(), MinNodesPerShard: 3, MetaChainMinNodes: 3, - AlterConfigsFunction: func(cfg *config.Configs) { - cfg.ExternalConfig.GRPCDriversConfig[0].Enabled = true - }, + //AlterConfigsFunction: func(cfg *config.Configs) { + // cfg.ExternalConfig.GRPCDriversConfig[0].Enabled = true + //}, }) require.Nil(t, err) require.NotNil(t, chainSimulator) diff --git a/outport/factory/outportFactory.go b/outport/factory/outportFactory.go index c72b15a07f0..3044f4285c9 100644 --- a/outport/factory/outportFactory.go +++ b/outport/factory/outportFactory.go @@ -1,6 +1,7 @@ package factory import ( + "context" "fmt" "time" @@ -11,7 +12,9 @@ import ( "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/config" "github.com/multiversx/mx-chain-go/outport" - grpc2 "github.com/multiversx/mx-chain-go/outport/grpc" + "github.com/multiversx/mx-chain-go/outport/grpcdriver" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) // OutportFactoryArgs holds the factory arguments of different outport drivers @@ -154,15 +157,34 @@ func createAndSubscribeGRPCDriverIfNeeded( return nil } - grpcClient, err := grpcadapter.NewOutportGRPCClient(args.GRPCClient.URL) + grpcClient, err := grpcadapter.NewOutportGRPCClient( + args.GRPCClient.URL, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithUnaryInterceptor(logGRPCOutportCalls), + ) if err != nil { return err } - grpcDriver, err := grpc2.NewGRPCDriver(grpcClient, args.Marshaller) + grpcDriver, err := grpcdriver.NewGRPCDriver(grpcClient, args.Marshaller) if err != nil { return err } return outport.SubscribeDriver(grpcDriver) } + +func logGRPCOutportCalls( + ctx context.Context, + method string, + req any, + reply any, + cc *grpc.ClientConn, + invoker grpc.UnaryInvoker, + opts ...grpc.CallOption, +) error { + start := time.Now() + err := invoker(ctx, method, req, reply, cc, opts...) + log.Debug("grpc call", "method", method, "duration", time.Since(start)) + return err +} diff --git a/outport/grpc/grpcDriver.go b/outport/grpcdriver/grpcDriver.go similarity index 61% rename from outport/grpc/grpcDriver.go rename to outport/grpcdriver/grpcDriver.go index 93d931eab31..69ca62f8f16 100644 --- a/outport/grpc/grpcDriver.go +++ b/outport/grpcdriver/grpcDriver.go @@ -1,8 +1,7 @@ -package grpc +package grpcdriver import ( "context" - "time" outportcore "github.com/multiversx/mx-chain-core-go/data/outport" "github.com/multiversx/mx-chain-core-go/data/outport/grpcadapter" @@ -26,73 +25,65 @@ func NewGRPCDriver(client grpcadapter.OutportClient, marshaller marshal.Marshali } func (g *grpcDriver) SaveBlock(outportBlock *outportcore.OutportBlock) error { - response, err := g.client.SaveBlock(context.Background(), outportBlock) + _, err := g.client.SaveBlock(context.Background(), outportBlock) if err != nil { return err } - d := time.Duration(response.IndexingTimeInMs) * time.Millisecond - log.Warn("grpcDriver.SaveBlock", "shardID", outportBlock.ShardID, "duration", d) return nil } func (g *grpcDriver) RevertIndexedBlock(blockData *outportcore.BlockData) error { - response, err := g.client.RevertIndexedBlock(context.Background(), blockData) + _, err := g.client.RevertIndexedBlock(context.Background(), blockData) if err != nil { return err } - log.Debug("grpcDriver.RevertIndexedBlock", "duration", response.IndexingTimeInMs) return nil } func (g *grpcDriver) SaveRoundsInfo(roundsInfos *outportcore.RoundsInfo) error { - response, err := g.client.SaveRoundsInfo(context.Background(), roundsInfos) + _, err := g.client.SaveRoundsInfo(context.Background(), roundsInfos) if err != nil { return err } - log.Debug("grpcDriver.SaveRoundsInfo", "duration", response.IndexingTimeInMs) return nil } func (g *grpcDriver) SaveValidatorsPubKeys(validatorsPubKeys *outportcore.ValidatorsPubKeys) error { - response, err := g.client.SaveValidatorsPubKeys(context.Background(), validatorsPubKeys) + _, err := g.client.SaveValidatorsPubKeys(context.Background(), validatorsPubKeys) if err != nil { return err } - log.Debug("grpcDriver.SaveValidatorsPubKeys", "duration", response.IndexingTimeInMs) return nil } func (g *grpcDriver) SaveValidatorsRating(validatorsRating *outportcore.ValidatorsRating) error { - response, err := g.client.SaveValidatorsRating(context.Background(), validatorsRating) + _, err := g.client.SaveValidatorsRating(context.Background(), validatorsRating) if err != nil { return err } - log.Debug("grpcDriver.SaveValidatorsRating", "duration", response.IndexingTimeInMs) return nil } func (g *grpcDriver) SaveAccounts(accounts *outportcore.Accounts) error { - response, err := g.client.SaveAccounts(context.Background(), accounts) + _, err := g.client.SaveAccounts(context.Background(), accounts) if err != nil { return err } - log.Debug("grpcDriver.SaveAccounts", "duration", response.IndexingTimeInMs) return nil } func (g *grpcDriver) FinalizedBlock(finalizedBlock *outportcore.FinalizedBlock) error { - response, err := g.client.FinalizedBlockEvent(context.Background(), finalizedBlock) + _, err := g.client.FinalizedBlockEvent(context.Background(), finalizedBlock) if err != nil { return err } - log.Debug("grpcDriver.FinalizedBlock", "duration", response.IndexingTimeInMs) return nil } From 70da6891b8146440e9ffe5ece827d15623cadfee Mon Sep 17 00:00:00 2001 From: miiu Date: Mon, 6 Apr 2026 11:46:54 +0300 Subject: [PATCH 4/9] comments --- outport/grpcdriver/grpcDriver.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/outport/grpcdriver/grpcDriver.go b/outport/grpcdriver/grpcDriver.go index 69ca62f8f16..b90641218de 100644 --- a/outport/grpcdriver/grpcDriver.go +++ b/outport/grpcdriver/grpcDriver.go @@ -7,16 +7,15 @@ import ( "github.com/multiversx/mx-chain-core-go/data/outport/grpcadapter" "github.com/multiversx/mx-chain-core-go/marshal" "github.com/multiversx/mx-chain-go/outport" - logger "github.com/multiversx/mx-chain-logger-go" ) -var log = logger.GetOrCreate("grpcDriver") - +// grpcDriver forwards outport driver calls to a remote gRPC outport service. type grpcDriver struct { client grpcadapter.OutportClient marshaller marshal.Marshalizer } +// NewGRPCDriver creates a driver implementation backed by a gRPC outport client. func NewGRPCDriver(client grpcadapter.OutportClient, marshaller marshal.Marshalizer) (outport.Driver, error) { return &grpcDriver{ client: client, @@ -24,6 +23,7 @@ func NewGRPCDriver(client grpcadapter.OutportClient, marshaller marshal.Marshali }, nil } +// SaveBlock forwards the block payload to the remote outport service. func (g *grpcDriver) SaveBlock(outportBlock *outportcore.OutportBlock) error { _, err := g.client.SaveBlock(context.Background(), outportBlock) if err != nil { @@ -33,6 +33,7 @@ func (g *grpcDriver) SaveBlock(outportBlock *outportcore.OutportBlock) error { return nil } +// RevertIndexedBlock calls the remote service to rollback indexed data for a block. func (g *grpcDriver) RevertIndexedBlock(blockData *outportcore.BlockData) error { _, err := g.client.RevertIndexedBlock(context.Background(), blockData) if err != nil { @@ -42,6 +43,7 @@ func (g *grpcDriver) RevertIndexedBlock(blockData *outportcore.BlockData) error return nil } +// SaveRoundsInfo synchronizes latest rounds metadata with the outport service. func (g *grpcDriver) SaveRoundsInfo(roundsInfos *outportcore.RoundsInfo) error { _, err := g.client.SaveRoundsInfo(context.Background(), roundsInfos) if err != nil { @@ -51,6 +53,7 @@ func (g *grpcDriver) SaveRoundsInfo(roundsInfos *outportcore.RoundsInfo) error { return nil } +// SaveValidatorsPubKeys sends validator keys to the remote store. func (g *grpcDriver) SaveValidatorsPubKeys(validatorsPubKeys *outportcore.ValidatorsPubKeys) error { _, err := g.client.SaveValidatorsPubKeys(context.Background(), validatorsPubKeys) if err != nil { @@ -60,6 +63,7 @@ func (g *grpcDriver) SaveValidatorsPubKeys(validatorsPubKeys *outportcore.Valida return nil } +// SaveValidatorsRating streams the current validators rating snapshot to gRPC. func (g *grpcDriver) SaveValidatorsRating(validatorsRating *outportcore.ValidatorsRating) error { _, err := g.client.SaveValidatorsRating(context.Background(), validatorsRating) if err != nil { @@ -69,6 +73,7 @@ func (g *grpcDriver) SaveValidatorsRating(validatorsRating *outportcore.Validato return nil } +// SaveAccounts writes account details via the remote controller. func (g *grpcDriver) SaveAccounts(accounts *outportcore.Accounts) error { _, err := g.client.SaveAccounts(context.Background(), accounts) if err != nil { @@ -78,6 +83,7 @@ func (g *grpcDriver) SaveAccounts(accounts *outportcore.Accounts) error { return nil } +// FinalizedBlock publishes the finalized block event over gRPC. func (g *grpcDriver) FinalizedBlock(finalizedBlock *outportcore.FinalizedBlock) error { _, err := g.client.FinalizedBlockEvent(context.Background(), finalizedBlock) if err != nil { @@ -87,22 +93,27 @@ func (g *grpcDriver) FinalizedBlock(finalizedBlock *outportcore.FinalizedBlock) return nil } +// GetMarshaller returns the marshaller assigned to this driver for serialization. func (g *grpcDriver) GetMarshaller() marshal.Marshalizer { return g.marshaller } +// SetCurrentSettings does nothing func (g *grpcDriver) SetCurrentSettings(_ outportcore.OutportConfig) error { return nil } +// RegisterHandler does nothings func (g *grpcDriver) RegisterHandler(_ func() error, _ string) error { return nil } +// Close does nothing/ func (g *grpcDriver) Close() error { return nil } +// IsInterfaceNil supports the interface nil check used by the caller. func (g *grpcDriver) IsInterfaceNil() bool { return g == nil } From 74866cb4f70e0388e82e06ff751beb50c152ea56 Mon Sep 17 00:00:00 2001 From: miiu Date: Tue, 12 May 2026 11:59:08 +0300 Subject: [PATCH 5/9] go version --- go.mod | 46 +++++++++++++------------- go.sum | 101 +++++++++++++++++++++++++++------------------------------ 2 files changed, 69 insertions(+), 78 deletions(-) diff --git a/go.mod b/go.mod index 2318edf5d5d..57dcfa366c3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/multiversx/mx-chain-go -go 1.24.0 +go 1.23 require ( github.com/beevik/ntp v1.3.0 @@ -16,8 +16,8 @@ require ( github.com/libp2p/go-libp2p v0.38.2 github.com/libp2p/go-libp2p-pubsub v0.13.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/multiversx/mx-chain-communication-go v1.3.1 - github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406083524-92a09acbba29 + github.com/multiversx/mx-chain-communication-go v1.3.0 + github.com/multiversx/mx-chain-core-go v1.5.1-0.20260512082900-27993689577d github.com/multiversx/mx-chain-crypto-go v1.3.1 github.com/multiversx/mx-chain-es-indexer-go v1.10.2 github.com/multiversx/mx-chain-logger-go v1.1.0 @@ -32,12 +32,12 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.20.5 github.com/shirou/gopsutil v3.21.11+incompatible - github.com/stretchr/testify v1.11.1 + github.com/stretchr/testify v1.10.0 github.com/urfave/cli v1.22.16 - golang.org/x/crypto v0.47.0 + golang.org/x/crypto v0.33.0 golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c - golang.org/x/sync v0.19.0 - google.golang.org/grpc v1.80.0 + golang.org/x/sync v0.11.0 + google.golang.org/grpc v1.67.1 gopkg.in/go-playground/validator.v8 v8.18.2 ) @@ -67,7 +67,7 @@ require ( github.com/francoispqt/gojay v1.2.13 // indirect github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-playground/locales v0.14.1 // indirect @@ -76,7 +76,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect @@ -171,7 +171,6 @@ require ( github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 // indirect github.com/raulk/go-watchdog v1.3.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/smartystreets/assertions v1.13.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tidwall/gjson v1.18.0 // indirect @@ -184,27 +183,26 @@ require ( github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect github.com/wlynxg/anet v0.0.5 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect - go.opentelemetry.io/otel/metric v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/mod v0.31.0 // indirect - golang.org/x/net v0.49.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc // indirect - golang.org/x/text v0.33.0 // indirect - golang.org/x/tools v0.40.0 // indirect - gonum.org/v1/gonum v0.17.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect - google.golang.org/protobuf v1.36.11 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect + golang.org/x/tools v0.29.0 // indirect + gonum.org/v1/gonum v0.15.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect + google.golang.org/protobuf v1.36.4 // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.3.0 // indirect diff --git a/go.sum b/go.sum index 4162d51f317..c7713effa34 100644 --- a/go.sum +++ b/go.sum @@ -135,8 +135,8 @@ github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmy github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= @@ -184,8 +184,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -197,8 +197,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -399,10 +399,10 @@ github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/n github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUYwbO0993uPI= github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o= -github.com/multiversx/mx-chain-communication-go v1.3.1 h1:rJj4FOTqacD+yaAfz61FoEtwpAYmOQFyLEHdy1YZya4= -github.com/multiversx/mx-chain-communication-go v1.3.1/go.mod h1:gDVWn6zUW6aCN1YOm/FbbT5MUmhgn/L1Rmpl8EoH3Yg= -github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406083524-92a09acbba29 h1:kAwTgXEgYieGpGg0ul9OQaHDFuGIdovDN4TPF11JdpQ= -github.com/multiversx/mx-chain-core-go v1.5.1-0.20260406083524-92a09acbba29/go.mod h1:3XR9EeZz9U5fSrEFLR3NyHOCa7tpdBs6C04ZA/rutEY= +github.com/multiversx/mx-chain-communication-go v1.3.0 h1:ziNM1dRuiR/7al2L/jGEA/a/hjurtJ/HEqgazHNt9P8= +github.com/multiversx/mx-chain-communication-go v1.3.0/go.mod h1:gDVWn6zUW6aCN1YOm/FbbT5MUmhgn/L1Rmpl8EoH3Yg= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260512082900-27993689577d h1:PajYv8TEvVWZFmZ7kRdO4gtlSDSpARW8sTqfOjZjdc8= +github.com/multiversx/mx-chain-core-go v1.5.1-0.20260512082900-27993689577d/go.mod h1:MClgyVtz/diZlfqBvHMC2RnHRHTOe59dvY7faN5HlNg= github.com/multiversx/mx-chain-crypto-go v1.3.1 h1:tCoGkfiv0wz97kuW6AZPW4RVL0Yp7PBo8NKQj9f2oh4= github.com/multiversx/mx-chain-crypto-go v1.3.1/go.mod h1:nPIkxxzyTP8IquWKds+22Q2OJ9W7LtusC7cAosz7ojM= github.com/multiversx/mx-chain-es-indexer-go v1.10.2 h1:mLFRUpZ2bWeYplU1e0kb318kk1x7AV9owq5B4XRdOqE= @@ -542,8 +542,8 @@ github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtD github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= -github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -576,9 +576,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= -github.com/smartystreets/assertions v1.13.1/go.mod h1:cXr/IwVfSo/RbCSPhoAPv73p3hlSdrBH/b3SdnW/LMY= github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= @@ -602,8 +601,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= @@ -643,23 +642,19 @@ github.com/xlab/treeprint v1.0.0/go.mod h1:IoImgRak9i3zJyuxOKUP1v4UZd1tMoKkq/Cim github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= -go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= @@ -701,8 +696,8 @@ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= @@ -718,8 +713,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= -golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -749,8 +744,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= -golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -765,8 +760,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= -golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -807,10 +802,8 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc h1:bH6xUXay0AIFMElXG2rQ4uiE+7ncwtiOdPfYK1NK2XA= -golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -830,8 +823,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -854,15 +847,15 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= -gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= +gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -877,8 +870,8 @@ google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 h1:sNrWoksmOyF5bvJUcnmbeAmQi8baNhqg5IWaI3llQqU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -887,8 +880,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= -google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -901,8 +894,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= 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 bbe785852396a80bafdd22f23d336d7f701ebf25 Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 14 May 2026 11:29:36 +0300 Subject: [PATCH 6/9] small fix --- dataRetriever/txpool/memorytests/memory_test.go | 2 +- outport/grpcdriver/grpcDriver.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dataRetriever/txpool/memorytests/memory_test.go b/dataRetriever/txpool/memorytests/memory_test.go index 727cdbdca72..936d3409372 100644 --- a/dataRetriever/txpool/memorytests/memory_test.go +++ b/dataRetriever/txpool/memorytests/memory_test.go @@ -46,7 +46,7 @@ func TestShardedTxPool_MemoryFootprint(t *testing.T) { // With larger memory footprint journals = append(journals, runScenario(t, newScenario(100000, 3, 650, "0"), memoryAssertion{290, 340}, memoryAssertion{80, 148})) - journals = append(journals, runScenario(t, newScenario(150000, 2, 650, "0"), memoryAssertion{290, 340}, memoryAssertion{90, 160})) + journals = append(journals, runScenario(t, newScenario(150000, 2, 650, "0"), memoryAssertion{290, 340}, memoryAssertion{90, 161})) journals = append(journals, runScenario(t, newScenario(300000, 1, 650, "0"), memoryAssertion{290, 340}, memoryAssertion{100, 190})) journals = append(journals, runScenario(t, newScenario(30, 10000, 650, "0"), memoryAssertion{290, 340}, memoryAssertion{60, 132})) journals = append(journals, runScenario(t, newScenario(300, 1000, 650, "0"), memoryAssertion{290, 340}, memoryAssertion{60, 148})) diff --git a/outport/grpcdriver/grpcDriver.go b/outport/grpcdriver/grpcDriver.go index b90641218de..28d985b9e5c 100644 --- a/outport/grpcdriver/grpcDriver.go +++ b/outport/grpcdriver/grpcDriver.go @@ -103,7 +103,7 @@ func (g *grpcDriver) SetCurrentSettings(_ outportcore.OutportConfig) error { return nil } -// RegisterHandler does nothings +// RegisterHandler does nothing func (g *grpcDriver) RegisterHandler(_ func() error, _ string) error { return nil } From 04dedff3a3bae92fb1553fa2417cf8f55293dc24 Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 14 May 2026 12:15:19 +0300 Subject: [PATCH 7/9] integration tests grpc driver enabled on chain simulator --- .../chainSimulator/outport/outport_test.go | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 integrationTests/chainSimulator/outport/outport_test.go diff --git a/integrationTests/chainSimulator/outport/outport_test.go b/integrationTests/chainSimulator/outport/outport_test.go new file mode 100644 index 00000000000..08176f49c29 --- /dev/null +++ b/integrationTests/chainSimulator/outport/outport_test.go @@ -0,0 +1,66 @@ +package outport + +import ( + "testing" + + "github.com/multiversx/mx-chain-core-go/core" + outportcore "github.com/multiversx/mx-chain-core-go/data/outport" + "github.com/multiversx/mx-chain-core-go/data/outport/grpcadapter" + "github.com/multiversx/mx-chain-go/config" + "github.com/multiversx/mx-chain-go/node/chainSimulator" + "github.com/multiversx/mx-chain-go/node/chainSimulator/components/api" + "github.com/multiversx/mx-chain-go/outport/mock" + "github.com/stretchr/testify/require" +) + +func TestChainSimulatorWithOutportGrpcEnabled(t *testing.T) { + count := 0 + indexer := &mock.DriverStub{ + SaveBlockCalled: func(outportBlock *outportcore.OutportBlock) error { + require.NotNil(t, outportBlock.BlockData) + count++ + return nil + }, + } + outportGRPCServer, err := grpcadapter.NewOutportGRPCServer("127.0.0.1:0", indexer) + require.Nil(t, err) + address := outportGRPCServer.Address() + require.NotEmpty(t, address) + + defer func() { + _ = outportGRPCServer.Close() + }() + go func() { + _ = outportGRPCServer.Start() + }() + + roundsPerEpochOpt := core.OptionalUint64{ + HasValue: true, + Value: 20, + } + + cs, err := chainSimulator.NewChainSimulator(chainSimulator.ArgsChainSimulator{ + BypassTxSignatureCheck: true, + BypassCreateBlockTimeCheck: true, + TempDir: t.TempDir(), + PathToInitialConfig: "../../../cmd/node/config/", + NumOfShards: 3, + RoundDurationInMillis: 6000, + SupernovaRoundDurationInMillis: 600, + RoundsPerEpoch: roundsPerEpochOpt, + SupernovaRoundsPerEpoch: roundsPerEpochOpt, + ApiInterface: api.NewNoApiInterface(), + MinNodesPerShard: 3, + MetaChainMinNodes: 3, + AlterConfigsFunction: func(cfg *config.Configs) { + cfg.ExternalConfig.GRPCDriversConfig[0].Enabled = true + cfg.ExternalConfig.GRPCDriversConfig[0].URL = address + }, + }) + require.Nil(t, err) + require.NotNil(t, cs) + + err = cs.GenerateBlocks(1) + require.Nil(t, err) + require.Equal(t, 8, count) +} From 04b644e3801ea22e2deaab8014bf571a1c1b407b Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 14 May 2026 12:27:40 +0300 Subject: [PATCH 8/9] disabled by default --- cmd/node/config/external.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/node/config/external.toml b/cmd/node/config/external.toml index 3acff61da2d..14b5a148da3 100644 --- a/cmd/node/config/external.toml +++ b/cmd/node/config/external.toml @@ -43,7 +43,7 @@ MarshallerType = "json" [[GRPCDriversConfig]] - Enabled = true + Enabled = false URL = "localhost:50051" MarshallerType = "json" From 389f64b0fe88dd8c46a25b6aab385201d4563d55 Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 14 May 2026 15:50:35 +0300 Subject: [PATCH 9/9] unit tests --- outport/grpcdriver/grpcDriver_test.go | 187 ++++++++++++++++++++++++++ outport/mock/grpcClientStub.go | 58 ++++++++ 2 files changed, 245 insertions(+) create mode 100644 outport/grpcdriver/grpcDriver_test.go create mode 100644 outport/mock/grpcClientStub.go diff --git a/outport/grpcdriver/grpcDriver_test.go b/outport/grpcdriver/grpcDriver_test.go new file mode 100644 index 00000000000..00daeb9cb33 --- /dev/null +++ b/outport/grpcdriver/grpcDriver_test.go @@ -0,0 +1,187 @@ +package grpcdriver + +import ( + "context" + "errors" + "testing" + + outportcore "github.com/multiversx/mx-chain-core-go/data/outport" + "github.com/multiversx/mx-chain-core-go/data/outport/grpcadapter" + "github.com/multiversx/mx-chain-go/outport/mock" + "github.com/multiversx/mx-chain-go/testscommon" + "github.com/stretchr/testify/require" +) + +func TestNewGRPCDriver(t *testing.T) { + t.Parallel() + + marshaller := &testscommon.MarshallerStub{} + client := &mock.OutportGRPCClientStub{} + + driver, err := NewGRPCDriver(client, marshaller) + + require.NoError(t, err) + require.NotNil(t, driver) + require.Same(t, marshaller, driver.GetMarshaller()) +} + +func TestGrpcDriverDelegatesCalls(t *testing.T) { + t.Parallel() + + expectedErr := errors.New("expected error") + + tests := []struct { + name string + client func(t *testing.T) grpcadapter.OutportClient + call func(driver *grpcDriver) error + }{ + { + name: "SaveBlock", + client: func(t *testing.T) grpcadapter.OutportClient { + expected := &outportcore.OutportBlock{ShardID: 1} + return &mock.OutportGRPCClientStub{ + SaveBlockCalled: func(ctx context.Context, in *outportcore.OutportBlock) error { + require.Equal(t, expected, in) + require.NotNil(t, ctx) + return expectedErr + }, + } + }, + call: func(driver *grpcDriver) error { + return driver.SaveBlock(&outportcore.OutportBlock{ShardID: 1}) + }, + }, + { + name: "RevertIndexedBlock", + client: func(t *testing.T) grpcadapter.OutportClient { + expected := &outportcore.BlockData{ShardID: 2} + return &mock.OutportGRPCClientStub{ + RevertIndexedBlockCalled: func(ctx context.Context, in *outportcore.BlockData) error { + require.Equal(t, expected, in) + require.NotNil(t, ctx) + return expectedErr + }, + } + }, + call: func(driver *grpcDriver) error { + return driver.RevertIndexedBlock(&outportcore.BlockData{ShardID: 2}) + }, + }, + { + name: "SaveRoundsInfo", + client: func(t *testing.T) grpcadapter.OutportClient { + expected := &outportcore.RoundsInfo{} + return &mock.OutportGRPCClientStub{ + SaveRoundsInfoCalled: func(ctx context.Context, in *outportcore.RoundsInfo) error { + require.Equal(t, expected, in) + require.NotNil(t, ctx) + return expectedErr + }, + } + }, + call: func(driver *grpcDriver) error { + return driver.SaveRoundsInfo(&outportcore.RoundsInfo{}) + }, + }, + { + name: "SaveValidatorsPubKeys", + client: func(t *testing.T) grpcadapter.OutportClient { + expected := &outportcore.ValidatorsPubKeys{ShardID: 3} + return &mock.OutportGRPCClientStub{ + SaveValidatorsPubKeysCalled: func(ctx context.Context, in *outportcore.ValidatorsPubKeys) error { + require.Equal(t, expected, in) + require.NotNil(t, ctx) + return expectedErr + }, + } + }, + call: func(driver *grpcDriver) error { + return driver.SaveValidatorsPubKeys(&outportcore.ValidatorsPubKeys{ShardID: 3}) + }, + }, + { + name: "SaveValidatorsRating", + client: func(t *testing.T) grpcadapter.OutportClient { + expected := &outportcore.ValidatorsRating{ShardID: 4} + return &mock.OutportGRPCClientStub{ + SaveValidatorsRatingCalled: func(ctx context.Context, in *outportcore.ValidatorsRating) error { + require.Equal(t, expected, in) + require.NotNil(t, ctx) + return expectedErr + }, + } + }, + call: func(driver *grpcDriver) error { + return driver.SaveValidatorsRating(&outportcore.ValidatorsRating{ShardID: 4}) + }, + }, + { + name: "SaveAccounts", + client: func(t *testing.T) grpcadapter.OutportClient { + expected := &outportcore.Accounts{ShardID: 5} + return &mock.OutportGRPCClientStub{ + SaveAccountsCalled: func(ctx context.Context, in *outportcore.Accounts) error { + require.Equal(t, expected, in) + require.NotNil(t, ctx) + return expectedErr + }, + } + }, + call: func(driver *grpcDriver) error { + return driver.SaveAccounts(&outportcore.Accounts{ShardID: 5}) + }, + }, + { + name: "FinalizedBlock", + client: func(t *testing.T) grpcadapter.OutportClient { + expected := &outportcore.FinalizedBlock{ShardID: 6} + return &mock.OutportGRPCClientStub{ + FinalizedBlockEventCalled: func(ctx context.Context, in *outportcore.FinalizedBlock) error { + require.Equal(t, expected, in) + require.NotNil(t, ctx) + return expectedErr + }, + } + }, + call: func(driver *grpcDriver) error { + return driver.FinalizedBlock(&outportcore.FinalizedBlock{ShardID: 6}) + }, + }, + } + + for _, test := range tests { + tt := test + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + driver := &grpcDriver{ + client: tt.client(t), + marshaller: &testscommon.MarshallerStub{}, + } + + err := tt.call(driver) + + require.ErrorIs(t, err, expectedErr) + }) + } +} + +func TestGrpcDriverNoOpMethods(t *testing.T) { + t.Parallel() + + driver := &grpcDriver{marshaller: &testscommon.MarshallerStub{}} + + require.NoError(t, driver.SetCurrentSettings(outportcore.OutportConfig{})) + require.NoError(t, driver.RegisterHandler(nil, "")) + require.NoError(t, driver.Close()) +} + +func TestGrpcDriverIsInterfaceNil(t *testing.T) { + t.Parallel() + + var nilDriver *grpcDriver + require.True(t, nilDriver.IsInterfaceNil()) + + driver := &grpcDriver{} + require.False(t, driver.IsInterfaceNil()) +} diff --git a/outport/mock/grpcClientStub.go b/outport/mock/grpcClientStub.go new file mode 100644 index 00000000000..f45bab1cf6b --- /dev/null +++ b/outport/mock/grpcClientStub.go @@ -0,0 +1,58 @@ +package mock + +import ( + "context" + + outportcore "github.com/multiversx/mx-chain-core-go/data/outport" +) + +// OutportGRPCClientStub - +type OutportGRPCClientStub struct { + SaveBlockCalled func(ctx context.Context, in *outportcore.OutportBlock) error + RevertIndexedBlockCalled func(ctx context.Context, in *outportcore.BlockData) error + SaveRoundsInfoCalled func(ctx context.Context, in *outportcore.RoundsInfo) error + SaveValidatorsPubKeysCalled func(ctx context.Context, in *outportcore.ValidatorsPubKeys) error + SaveValidatorsRatingCalled func(ctx context.Context, in *outportcore.ValidatorsRating) error + SaveAccountsCalled func(ctx context.Context, in *outportcore.Accounts) error + FinalizedBlockEventCalled func(ctx context.Context, in *outportcore.FinalizedBlock) error +} + +// SaveBlock - +func (stub *OutportGRPCClientStub) SaveBlock(ctx context.Context, in *outportcore.OutportBlock) (*outportcore.ResponseData, error) { + return nil, stub.SaveBlockCalled(ctx, in) +} + +// RevertIndexedBlock - +func (stub *OutportGRPCClientStub) RevertIndexedBlock(ctx context.Context, in *outportcore.BlockData) (*outportcore.ResponseData, error) { + return nil, stub.RevertIndexedBlockCalled(ctx, in) +} + +// SaveRoundsInfo - +func (stub *OutportGRPCClientStub) SaveRoundsInfo(ctx context.Context, in *outportcore.RoundsInfo) (*outportcore.ResponseData, error) { + return nil, stub.SaveRoundsInfoCalled(ctx, in) +} + +// SaveValidatorsPubKeys - +func (stub *OutportGRPCClientStub) SaveValidatorsPubKeys(ctx context.Context, in *outportcore.ValidatorsPubKeys) (*outportcore.ResponseData, error) { + return nil, stub.SaveValidatorsPubKeysCalled(ctx, in) +} + +// SaveValidatorsRating - +func (stub *OutportGRPCClientStub) SaveValidatorsRating(ctx context.Context, in *outportcore.ValidatorsRating) (*outportcore.ResponseData, error) { + return nil, stub.SaveValidatorsRatingCalled(ctx, in) +} + +// SaveAccounts - +func (stub *OutportGRPCClientStub) SaveAccounts(ctx context.Context, in *outportcore.Accounts) (*outportcore.ResponseData, error) { + return nil, stub.SaveAccountsCalled(ctx, in) +} + +// FinalizedBlockEvent - +func (stub *OutportGRPCClientStub) FinalizedBlockEvent(ctx context.Context, in *outportcore.FinalizedBlock) (*outportcore.ResponseData, error) { + return nil, stub.FinalizedBlockEventCalled(ctx, in) +} + +// IsInterfaceNil - +func (stub *OutportGRPCClientStub) IsInterfaceNil() bool { + return stub == nil +}