From 35a49100f45c2817f6fabd6b8590e1520b68d185 Mon Sep 17 00:00:00 2001 From: Semyon Novikov Date: Tue, 27 Feb 2024 11:18:19 +0300 Subject: [PATCH 1/6] new logic for service type http --- .gitignore | 7 ++ README.md | 25 +++-- blockchain/serviceMetadata.go | 163 ++++++++++++++++++++++++------- codec/codec.go | 3 +- escrow/control_service.go | 14 ++- go.mod | 32 +++---- go.sum | 68 ++++++------- handler/grpc.go | 174 ++++++++++++++++++++++++---------- ipfsutils/ipfsutils.go | 7 +- scripts/install | 4 - 10 files changed, 341 insertions(+), 156 deletions(-) diff --git a/.gitignore b/.gitignore index 7b66bea0..266ac63a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ +# idea cache .idea/ + +# npm cache and configs resources/blockchain/node_modules/ resources/blockchain/build/ snetd.db @@ -13,6 +16,10 @@ blockchain/multi_party_escrow.go blockchain/singularity_net_token.go *.pb.go +# service proto +service.proto +service.proto-tmp.pb + # Binaries for programs and plugins *.exe *.exe~ diff --git a/README.md b/README.md index e207b12a..2010650c 100644 --- a/README.md +++ b/README.md @@ -159,24 +159,29 @@ These properties you should usually change before starting daemon for the first time. * **blockchain_network_selected** (required) - Name of the network to be used for Daemon possible values are one of (kovan,ropsten,main,local or rinkeby). + Name of the network to be used for Daemon possible values are one of (goerli, sepolia, main, local). Daemon will automatically read the Registry address associated with this network For local network ( you can also specify the registry address manually),see the blockchain_network_config.json -* **daemon_type** (required;) - - Defines the type of service. Available values :grpc, - jsonrpc, [http](https://dev.singularitynet.io/docs/ai-developers/service-type-http/), process. - -* **service_credentials** (required if daemon_type is http): +* **service_credentials** (optional, for service_type http only): Array of credentials, example: ``` -[{"key": "X-Banana-API-Key", -"value": "546bd7d4-d3e1-46ba-b752-bc45e4dc5b39", -"location": "header"}] +"service_credentials": [ + { + "key": "example_body_param", + "value": 12345, + "location": "body" + }, + { + "key": "X-API-Key", + "value": "546bd7d4-d3e1-46ba-b752-bc45e4dc5b39", + "location": "header" + } + ], ``` -Location can be: query or header +Location can be: query, header or body. Query and header values must be string. * **daemon_end_point** (required;) - Defines the ip and the port on which the daemon listens to. diff --git a/blockchain/serviceMetadata.go b/blockchain/serviceMetadata.go index 8ee38e6c..0a62c5a5 100644 --- a/blockchain/serviceMetadata.go +++ b/blockchain/serviceMetadata.go @@ -3,14 +3,21 @@ package blockchain import ( "encoding/json" "fmt" - "github.com/emicklei/proto" + pproto "github.com/emicklei/proto" "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" "github.com/singnet/snet-daemon/config" "github.com/singnet/snet-daemon/ipfsutils" log "github.com/sirupsen/logrus" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protodesc" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/descriptorpb" "math/big" "os" + "os/exec" + "path" "strings" ) @@ -137,7 +144,10 @@ import ( ] } */ -const IpfsPrefix = "ipfs://" +const ( + IpfsPrefix = "ipfs://" + serviceProto = "service.proto" +) type ServiceMetadata struct { Version int `json:"version"` @@ -156,8 +166,9 @@ type ServiceMetadata struct { freeCallSignerAddress common.Address isfreeCallAllowed bool freeCallsAllowed int - dynamicPriceMethodMapping map[string]string `json:"dynamicpricing"` - trainingMethods []string `json:"training_methods"` + DynamicPriceMethodMapping map[string]string `json:"dynamicpricing"` + TrainingMethods []string `json:"training_methods"` + ProtoFile protoreflect.FileDescriptor `json:"-"` } type Tiers struct { Tiers Tier `json:"tier"` @@ -270,10 +281,7 @@ func ReadServiceMetaDataFromLocalFile(filename string) (*ServiceMetadata, error) func getRegistryCaller() (reg *RegistryCaller) { ethClient, err := GetEthereumClient() if err != nil { - - log.WithError(err). - Panic("Unable to get Blockchain client ") - + log.WithError(err).Panic("Unable to get Blockchain client ") } defer ethClient.Close() registryContractAddress := getRegistryAddressKey() @@ -320,25 +328,24 @@ func InitServiceMetaDataFromJson(jsonData string) (*ServiceMetadata, error) { if err := setFreeCallData(metaData); err != nil { return nil, err } - //If Dynamic pricing is enabled ,there will be mandatory checks on the service proto - //this is to ensure that the standards on how one defines the methods to invoke is followed - if config.GetBool(config.EnableDynamicPricing) { - if err := setServiceProto(metaData); err != nil { - return nil, err - } + + if err := setServiceProto(metaData); err != nil { + return nil, err } - e, err := json.Marshal(metaData.dynamicPriceMethodMapping) + dynamicPriceMethodMappingJson, err := json.Marshal(metaData.DynamicPriceMethodMapping) if err != nil { log.Println(err) } - log.Println(string(e)) - e1, err := json.Marshal(metaData.trainingMethods) + log.Debugln("dynamicPriceMethodMappingJson: ", string(dynamicPriceMethodMappingJson)) + + trainingMethodsJson, err := json.Marshal(metaData.TrainingMethods) if err != nil { log.Println(err) } - log.Println(string(e1)) + log.Debugln("trainingMethodsJson: ", string(trainingMethodsJson)) + return metaData, err } @@ -445,7 +452,7 @@ func (metaData *ServiceMetadata) GetDynamicPricingMethodAssociated(methodFullNam if !config.GetBool(config.EnableDynamicPricing) { return } - pricingMethod = metaData.dynamicPriceMethodMapping[methodFullName] + pricingMethod = metaData.DynamicPriceMethodMapping[methodFullName] if strings.Compare("", pricingMethod) == 0 { isDynamicPricingEligible = false } else { @@ -460,9 +467,10 @@ func (metaData *ServiceMetadata) IsModelTraining(methodFullName string) (useMode if !config.GetBool(config.ModelTrainingEnabled) { return false } - useModelTrainingEndPoint = isElementInArray(methodFullName, metaData.trainingMethods) + useModelTrainingEndPoint = isElementInArray(methodFullName, metaData.TrainingMethods) return } + func isElementInArray(a string, list []string) bool { for _, b := range list { if b == a { @@ -471,30 +479,116 @@ func isElementInArray(a string, list []string) bool { } return false } + +func createProtoRegistry(srcDir string, filename string) (*protoregistry.Files, error) { + // Create descriptors using the protoc binary. + // Imported dependencies are included so that the descriptors are self-contained. + tmpFile := filename + "-tmp.pb" + cmd := exec.Command("protoc", + "--include_imports", + "--descriptor_set_out="+tmpFile, + "-I"+srcDir, + path.Join(srcDir, filename)) + + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Run() + if err != nil { + return nil, err + } + //defer os.Remove(tmpFile) + + marshalledDescriptorSet, err := os.ReadFile(tmpFile) + if err != nil { + return nil, err + } + descriptorSet := descriptorpb.FileDescriptorSet{} + err = proto.Unmarshal(marshalledDescriptorSet, &descriptorSet) + if err != nil { + log.Println("can't unmarshal: ", err) + return nil, err + } + + files, err := protodesc.NewFiles(&descriptorSet) + if err != nil { + log.Println(err) + return nil, err + } + + return files, nil +} + func setServiceProto(metaData *ServiceMetadata) (err error) { - metaData.dynamicPriceMethodMapping = make(map[string]string, 0) - metaData.trainingMethods = make([]string, 0) + metaData.DynamicPriceMethodMapping = make(map[string]string, 0) + metaData.TrainingMethods = make([]string, 0) //This is to handler the scenario where there could be multiple protos associated with the service proto protoFiles, err := ipfsutils.ReadFilesCompressed(ipfsutils.GetIpfsFile(metaData.ModelIpfsHash)) + if err != nil { + return err + } + + if metaData.ServiceType == "http" { + if len(protoFiles) > 1 { + log.Fatalln("daemon support only one proto file for HTTP services!") + } + } + for _, file := range protoFiles { - if srvProto, err := parseServiceProto(file); err != nil { - return err - } else { - dynamicMethodMap, trainingMethodMap, err := buildDynamicPricingMethodsMap(srvProto) + log.Debugln("Protofile: ", file) + + if metaData.ServiceType == "http" { + _, err = os.Create(serviceProto) if err != nil { + log.Fatalln("Can't create proto file: ", err) + } + + err = os.WriteFile(serviceProto, []byte(file), 0666) + if err != nil { + log.Fatalln("Can't write to proto file: ", err) + } + } + + //If Dynamic pricing is enabled ,there will be mandatory checks on the service proto + //this is to ensure that the standards on how one defines the methods to invoke is followed + if config.GetBool(config.EnableDynamicPricing) { + if srvProto, err := parseServiceProto(file); err != nil { return err + } else { + dynamicMethodMap, trainingMethodMap, err := buildDynamicPricingMethodsMap(srvProto) + if err != nil { + return err + } + metaData.DynamicPriceMethodMapping = dynamicMethodMap + metaData.TrainingMethods = trainingMethodMap } - metaData.dynamicPriceMethodMapping = dynamicMethodMap - metaData.trainingMethods = trainingMethodMap } } + if metaData.ServiceType == "http" { + files, err := createProtoRegistry(".", serviceProto) + if err != nil { + log.Println("createProtoRegistry: ", err) + } + + protoFile, err := files.FindFileByPath(serviceProto) + if err != nil { + log.Println("files.FindFileByPat: ", err) + } + + err = files.RegisterFile(protoFile) + if err != nil { + log.Println("files.RegisterFile(desc): ", err) + } + + metaData.ProtoFile = protoFile + } + return nil } -func parseServiceProto(serviceProtoFile string) (*proto.Proto, error) { +func parseServiceProto(serviceProtoFile string) (*pproto.Proto, error) { reader := strings.NewReader(serviceProtoFile) - parser := proto.NewParser(reader) + parser := pproto.NewParser(reader) parsedProto, err := parser.Parse() if err != nil { return nil, err @@ -502,21 +596,20 @@ func parseServiceProto(serviceProtoFile string) (*proto.Proto, error) { return parsedProto, nil } -func buildDynamicPricingMethodsMap(serviceProto *proto.Proto) (dynamicPricingMethodMapping map[string]string, +func buildDynamicPricingMethodsMap(serviceProto *pproto.Proto) (dynamicPricingMethodMapping map[string]string, trainingMethodPricing []string, err error) { dynamicPricingMethodMapping = make(map[string]string, 0) trainingMethodPricing = make([]string, 0) var pkgName, serviceName, methodName string for _, elem := range serviceProto.Elements { //package is parsed earlier than service ( per documentation) - if pkg, ok := elem.(*proto.Package); ok { + if pkg, ok := elem.(*pproto.Package); ok { pkgName = pkg.Name } - - if service, ok := elem.(*proto.Service); ok { + if service, ok := elem.(*pproto.Service); ok { serviceName = service.Name for _, serviceElements := range service.Elements { - if rpcMethod, ok := serviceElements.(*proto.RPC); ok { + if rpcMethod, ok := serviceElements.(*pproto.RPC); ok { methodName = rpcMethod.Name for _, methodOption := range rpcMethod.Options { if strings.Compare(methodOption.Name, "(pricing.my_method_option).estimatePriceMethod") == 0 { diff --git a/codec/codec.go b/codec/codec.go index 02c91488..123c7f24 100644 --- a/codec/codec.go +++ b/codec/codec.go @@ -3,6 +3,7 @@ package codec import ( "fmt" "google.golang.org/grpc/encoding" + _ "google.golang.org/grpc/encoding/proto" // ensure default "proto" codec is registered first _ "google.golang.org/protobuf/encoding/protojson" // ensure default "proto" codec is registered first "google.golang.org/protobuf/proto" "google.golang.org/protobuf/protoadapt" @@ -60,7 +61,7 @@ Copied from https://github.com/mwitkow/grpc-proxy/blob/67591eb23c48346a480470e46 Original Copyright 2017 Michal Witkowski. All Rights Reserved. See LICENSE-GRPC-PROXY for licensing terms. Modifications Copyright 2018 SingularityNET Foundation. All Rights Reserved. See LICENSE for licensing terms. */ -// protoCodec is a Codec implementation with protobuf. It is the default rawCodec for gRPC. +//protoCodec is a Codec implementation with protobuf. It is the default rawCodec for gRPC. type protoCodec struct{} func (protoCodec) Marshal(v interface{}) ([]byte, error) { diff --git a/escrow/control_service.go b/escrow/control_service.go index 0186d457..f3ebbf6e 100644 --- a/escrow/control_service.go +++ b/escrow/control_service.go @@ -7,12 +7,12 @@ import ( "fmt" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" - "github.com/gogo/protobuf/sortkeys" "github.com/singnet/snet-daemon/authutils" "github.com/singnet/snet-daemon/blockchain" log "github.com/sirupsen/logrus" "golang.org/x/net/context" "math/big" + "sort" ) type ProviderControlService struct { @@ -148,7 +148,7 @@ func getBytesOfChannelIds(request *StartMultipleClaimRequest) []byte { channelIds = append(channelIds, channelId) } //sort the channel Ids - sortkeys.Uint64s(channelIds) + Uint64s(channelIds) channelIdInBytes := make([]byte, 0) for index, channelId := range channelIds { @@ -167,6 +167,16 @@ func getBytesOfChannelIds(request *StartMultipleClaimRequest) []byte { return channelIdInBytes } +type Uint64Slice []uint64 + +func Uint64s(l []uint64) { + sort.Sort(Uint64Slice(l)) +} + +func (p Uint64Slice) Len() int { return len(p) } +func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } +func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + // Get the list of all claims that have been initiated but not completed yet. // Verify that mpe_address is correct // Verify that actual block_number is not very different (+-5 blocks) from the current_block_number from the signature diff --git a/go.mod b/go.mod index a5a3bde7..6301b00b 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,12 @@ module github.com/singnet/snet-daemon -go 1.21 +go 1.22 require ( github.com/OneOfOne/go-utils v0.0.0-20180319162427-6019ff89a94e github.com/coreos/pkg v0.0.0-20240122114842-bbd7aa9bf6fb github.com/emicklei/proto v1.13.2 - github.com/ethereum/go-ethereum v1.13.11 - github.com/gogo/protobuf v1.3.2 + github.com/ethereum/go-ethereum v1.13.13 github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/gorilla/handlers v1.5.2 @@ -32,10 +31,10 @@ require ( github.com/zbindenren/logrus_mail v0.0.0-20201006120535-9ec03a23b467 go.etcd.io/etcd/client/v3 v3.5.12 go.etcd.io/etcd/server/v3 v3.5.12 - golang.org/x/crypto v0.18.0 - golang.org/x/net v0.20.0 + golang.org/x/crypto v0.19.0 + golang.org/x/net v0.21.0 golang.org/x/time v0.5.0 - google.golang.org/grpc v1.61.0 + google.golang.org/grpc v1.62.0 google.golang.org/protobuf v1.32.0 ) @@ -70,10 +69,10 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/ethereum/c-kzg-4844 v0.4.0 // indirect + github.com/ethereum/c-kzg-4844 v0.4.2 // indirect github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect + github.com/fjl/memsize v0.0.2 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect @@ -81,6 +80,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gofrs/flock v0.8.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect @@ -97,7 +97,7 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect + github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.4 // indirect github.com/huin/goupnp v1.3.0 // indirect @@ -207,16 +207,16 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect go4.org v0.0.0-20230225012048-214862532bf5 // indirect - golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect - golang.org/x/mod v0.14.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/mod v0.15.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.17.0 // indirect + golang.org/x/tools v0.18.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index fc42af8a..9a2b47fa 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= +cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= @@ -110,8 +110,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY= -github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= @@ -204,13 +204,13 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= -github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.11 h1:b51Dsm+rEg7anFRUMGB8hODXHvNfcRKzz9vcj8wSdUs= -github.com/ethereum/go-ethereum v1.13.11/go.mod h1:gFtlVORuUcT+UUIcJ/veCNjkuOSujCi338uSHJrYAew= +github.com/ethereum/c-kzg-4844 v0.4.2 h1:99hCflha4YhQ2cW9H/X3QFv7vs78cCvSxOteEsTvKnQ= +github.com/ethereum/c-kzg-4844 v0.4.2/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.13.13 h1:KYn9w7pEWRI9oyZOzO94OVbctSusPByHdFDPj634jII= +github.com/ethereum/go-ethereum v1.13.13/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= @@ -218,8 +218,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= +github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/flynn/noise v1.0.1 h1:vPp/jdQLXC6ppsXSj/pM3W1BIJ5FEHE2TulSJBpb43Y= github.com/flynn/noise v1.0.1/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= @@ -433,8 +433,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= @@ -1139,8 +1139,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1150,8 +1150,8 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1174,8 +1174,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.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.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1215,8 +1215,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1295,8 +1295,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.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 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.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= @@ -1354,8 +1354,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 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.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= 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= @@ -1400,12 +1400,12 @@ google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe h1:USL2DhxfgRchafRvt/wYyyQNzwgL7ZiURcozOE/Pkvo= -google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1424,8 +1424,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/handler/grpc.go b/handler/grpc.go index e62b6364..ded749ba 100644 --- a/handler/grpc.go +++ b/handler/grpc.go @@ -4,22 +4,26 @@ import ( "bytes" "context" "encoding/json" - "github.com/singnet/snet-daemon/blockchain" - "google.golang.org/grpc/credentials" - "io" - "net/http" - "net/url" - "os/exec" - "strings" - "github.com/gorilla/rpc/v2/json2" + "github.com/singnet/snet-daemon/blockchain" "github.com/singnet/snet-daemon/codec" "github.com/singnet/snet-daemon/config" log "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/dynamicpb" + "google.golang.org/protobuf/types/known/emptypb" + "io" + "net/http" + "net/url" + "os/exec" + "strings" ) var grpcDesc = &grpc.StreamDesc{ServerStreams: true, ClientStreams: true} @@ -173,7 +177,7 @@ Modifications Copyright 2018 SingularityNET Foundation. All Rights Reserved. See func forwardClientToServer(src grpc.ClientStream, dst grpc.ServerStream) chan error { ret := make(chan error, 1) go func() { - f := &codec.GrpcFrame{} + f := &emptypb.Empty{} for i := 0; ; i++ { if err := src.RecvMsg(f); err != nil { ret <- err // this can be io.EOF which is happy case @@ -210,7 +214,7 @@ Modifications Copyright 2018 SingularityNET Foundation. All Rights Reserved. See func forwardServerToClient(src grpc.ServerStream, dst grpc.ClientStream) chan error { ret := make(chan error, 1) go func() { - f := &codec.GrpcFrame{} + f := &emptypb.Empty{} for i := 0; ; i++ { //Only for the first time do this, once RecvMsg has been called, //future calls will result in io.EOF , we want to retrieve the @@ -220,12 +224,12 @@ func forwardServerToClient(src grpc.ServerStream, dst grpc.ClientStream) chan er //todo we need to think through to determine price for every call on stream calls //will be handled when we support streaming and pricing across all clients in snet-platform if wrappedStream, ok := src.(*WrapperServerStream); ok { - f = (wrappedStream.OriginalRecvMsg()).(*codec.GrpcFrame) + f = (wrappedStream.OriginalRecvMsg()).(*emptypb.Empty) } else if err := src.RecvMsg(f); err != nil { ret <- err + log.Println("err: ", err) break } - } else if err := src.RecvMsg(f); err != nil { ret <- err // this can be io.EOF which is happy case break @@ -247,7 +251,7 @@ var header httpLocation = "header" type serviceCredential struct { Key string `json:"key"` - Value string `json:"value"` + Value any `json:"value"` Location httpLocation `json:"location"` } @@ -261,53 +265,63 @@ func (g grpcHandler) grpcToHTTP(srv interface{}, inStream grpc.ServerStream) err methodSegs := strings.Split(method, "/") method = methodSegs[len(methodSegs)-1] - if !ok { - return status.Errorf(codes.Internal, "could not get metadata from incoming context") - } + log.Debugln("Calling Method: ", method) f := &codec.GrpcFrame{} if err := inStream.RecvMsg(f); err != nil { + log.Println(err) return status.Errorf(codes.Internal, "error receiving request; error: %+cred", err) } - log.Debugln("string input: ", string(f.Data)) - jsonInput := f.Data[2:] // trim grpc headers - log.Debugln("string input trimmed: ", string(jsonInput)) + // convert proto msg to json + jsonBody := protoToJson(g.serviceMetaData.ProtoFile, f.Data, method) + + log.Debugln("Proto to json: ", string(jsonBody)) base, err := url.Parse(g.passthroughEndpoint) if err != nil { log.Println("cant' parse passthroughEndpoint: ", err) } - //base.Path += method + base.Path += method // method from proto should be the same as http handler path params := url.Values{} - var headers = http.Header{} + headers := http.Header{} - //var bodymap = map[string]any{} - //err = json.Unmarshal(f.Data, &bodymap) - //if err != nil { - // log.Println(err) - //} + var bodymap = map[string]any{} + errJson := json.Unmarshal(jsonBody, &bodymap) for _, cred := range g.serviceCredentials { switch cred.Location { case query: - params.Add(cred.Key, cred.Value) - //case body: - // bodymap[cred.Key] = cred.Value + v, ok := cred.Value.(string) + if ok { + params.Add(cred.Key, v) + } + case body: + if errJson == nil { + bodymap[cred.Key] = cred.Value + } case header: - headers.Set(cred.Key, cred.Value) + v, ok := cred.Value.(string) + if ok { + headers.Set(cred.Key, v) + } } } - //dataBytes, err := json.Marshal(bodymap) - //if err != nil { - // return status.Errorf(codes.Internal, "error executing http call: json.Marshal; error: %+cred", err) - //} + if errJson == nil { + newJson, err := json.Marshal(bodymap) + if err == nil { + jsonBody = newJson + } else { + log.Debugln("Can't marshal json: ", err) + } + } base.RawQuery = params.Encode() - httpReq, err := http.NewRequest("POST", base.String(), bytes.NewBuffer(jsonInput)) + log.Debugln("Calling URL: ", base.String()) + httpReq, err := http.NewRequest("POST", base.String(), bytes.NewBuffer(jsonBody)) httpReq.Header = headers if err != nil { return status.Errorf(codes.Internal, "error creating http request; error: %+cred", err) @@ -325,22 +339,86 @@ func (g grpcHandler) grpcToHTTP(srv interface{}, inStream grpc.ServerStream) err if err != nil { return status.Errorf(codes.Internal, "error reading response; error: %+cred", err) } - dataSize := len(resp) - thirdByte := dataSize / 128 - remainingBytes := dataSize % 128 - secondByte := remainingBytes + 128 - compressedFlag := 10 // first byte - var respData = append([]byte{byte(compressedFlag), byte(secondByte), byte(thirdByte)}, resp...) - //log.Println("bytes resp: ", respData) - log.Debugln("string resp: ", string(respData)) - f = &codec.GrpcFrame{Data: respData} - if err = inStream.SendMsg(f); err != nil { + log.Println("string resp: ", string(resp)) + + protoMessage := jsonToProto(g.serviceMetaData.ProtoFile, resp, method) + if err = inStream.SendMsg(protoMessage); err != nil { return status.Errorf(codes.Internal, "error sending response; error: %+cred", err) } return nil } +func jsonToProto(protoFile protoreflect.FileDescriptor, json []byte, methodName string) (proto proto.Message) { + + log.Debugln("Processing file:", protoFile.Name()) + log.Debugln("Count services: ", protoFile.Services().Len()) + + if protoFile.Services().Len() == 0 { + log.Println("service in proto not found") + return proto + } + + service := protoFile.Services().Get(0) + if service == nil { + log.Println("service in proto not found") + return proto + } + + method := service.Methods().ByName(protoreflect.Name(methodName)) + if method == nil { + log.Println("method not found") + return proto + } + output := method.Output() + log.Debugln("Calling method name from proto: ", output.Name()) + log.Debugln("Calling method fullname from proto: ", output.FullName()) + proto = dynamicpb.NewMessage(output) + err := protojson.Unmarshal(json, proto) + if err != nil { + log.Println("Can't unmarshal protojson: ", err) + } + + return proto +} + +func protoToJson(protoFile protoreflect.FileDescriptor, in []byte, methodName string) (json []byte) { + + if protoFile.Services().Len() == 0 { + log.Println("service in proto not found") + return []byte("error, invalid proto file") + } + + service := protoFile.Services().Get(0) + if service == nil { + log.Println("service in proto not found") + return []byte("error, invalid proto file") + } + + method := service.Methods().ByName(protoreflect.Name(methodName)) + if method == nil { + log.Println("method not found") + return []byte("error, invalid proto file or input request") + } + + input := method.Input() + log.Debugln("Input fullname method: ", input.FullName()) + msg := dynamicpb.NewMessage(input) + err := proto.Unmarshal(in, msg) + if err != nil { + log.Println("proto.Unmarshal: ", err) + return []byte("error, invalid proto file or input request") + } + json, err = protojson.Marshal(msg) + if err != nil { + log.Println("protojson.Marshal: ", err) + return []byte("error, invalid proto file or input request") + } + log.Debugln("jsonBytes: ", string(json)) + + return json +} + func (g grpcHandler) grpcToJSONRPC(srv interface{}, inStream grpc.ServerStream) error { method, ok := grpc.MethodFromServerStream(inStream) @@ -385,7 +463,7 @@ func (g grpcHandler) grpcToJSONRPC(srv interface{}, inStream grpc.ServerStream) return status.Errorf(codes.Internal, "error executing http call; error: %+v", err) } - result := new(interface{}) + result := new(any) if err = json2.DecodeClientResponse(httpResp.Body, result); err != nil { return status.Errorf(codes.Internal, "json-rpc error; error: %+v", err) @@ -409,8 +487,8 @@ func (g grpcHandler) grpcToJSONRPC(srv interface{}, inStream grpc.ServerStream) type WrapperServerStream struct { sendHeaderCalled bool stream grpc.ServerStream - recvMessage interface{} - sentMessage interface{} + recvMessage any + sentMessage any } func (f *WrapperServerStream) SetTrailer(md metadata.MD) { diff --git a/ipfsutils/ipfsutils.go b/ipfsutils/ipfsutils.go index 62997de3..0daa4fde 100644 --- a/ipfsutils/ipfsutils.go +++ b/ipfsutils/ipfsutils.go @@ -89,12 +89,7 @@ func GetIpfsFile(hash string) (content string) { return } - log.WithField("hash", hash).WithField("blob", string(fileContent)).Debug("Blob of IPFS file with hash") - - //sum, err := cID.Prefix().Sum(fileContent) - //if err != nil { - // log.WithError(err).Panicf("error in generating the hash for the meta data read from IPFS : %v", err) - //} + // log.WithField("hash", hash).WithField("blob", string(fileContent)).Debug("Blob of IPFS file with hash") // Create a cid manually to check cid _, c, err := cid.CidFromBytes(append(cID.Bytes(), fileContent...)) diff --git a/scripts/install b/scripts/install index 62800fd2..1da1aaac 100755 --- a/scripts/install +++ b/scripts/install @@ -6,10 +6,6 @@ PARENT_PATH=$(dirname $(cd $(dirname $0); pwd -P)) pushd $PARENT_PATH -go get -u google.golang.org/protobuf@latest -go get -u google.golang.org/grpc@latest -go get -u golang.org/x/lint/golint@latest - go install github.com/ethereum/go-ethereum/cmd/abigen@latest go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest From f6e1aa9b4c78d58a4a1ee96026d9fd44b6542dd0 Mon Sep 17 00:00:00 2001 From: Semyon Novikov Date: Tue, 27 Feb 2024 11:22:18 +0300 Subject: [PATCH 2/6] update golang.org/x/crypto --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6301b00b..5b466cee 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/zbindenren/logrus_mail v0.0.0-20201006120535-9ec03a23b467 go.etcd.io/etcd/client/v3 v3.5.12 go.etcd.io/etcd/server/v3 v3.5.12 - golang.org/x/crypto v0.19.0 + golang.org/x/crypto v0.20.0 golang.org/x/net v0.21.0 golang.org/x/time v0.5.0 google.golang.org/grpc v1.62.0 diff --git a/go.sum b/go.sum index 9a2b47fa..39645df6 100644 --- a/go.sum +++ b/go.sum @@ -1141,6 +1141,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= +golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= From 79b1bbefbbc02fc92003bec0ce20166fa0d2ecd0 Mon Sep 17 00:00:00 2001 From: Semyon Novikov Date: Tue, 27 Feb 2024 13:00:58 +0300 Subject: [PATCH 3/6] update training.proto --- training/training.proto | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/training/training.proto b/training/training.proto index d1375c68..892f51d4 100644 --- a/training/training.proto +++ b/training/training.proto @@ -94,7 +94,7 @@ message ModelDetailsResponse { service Model { - // The AI developer needs to Implement this service and Daemon will call these + // The AI developer needs to Implement this service (do not copy this in your service proto) and Daemon will call these // There will be no cost borne by the consumer in calling these methods, // Pricing will apply when you actually call the training methods defined. // AI consumer will call all these methods @@ -102,13 +102,8 @@ service Model { rpc delete_model(UpdateModelRequest) returns (ModelDetailsResponse) {} rpc get_model_status(ModelDetailsRequest) returns (ModelDetailsResponse) {} - // rpc train_method(ModelDetailsRequest) returns (ModelDetailsRequest) { - // // Applying an extension to a method - // option (my_method_option).trainingMethodIndicator = "example_service.train_method/estimate_add"; - // } - - // Daemon will implement , however the AI developer should skip implementing these and just provide dummy code. + // Daemon will implement, however the AI developer should skip implementing these and just provide dummy code. rpc update_model_access(UpdateModelRequest) returns (ModelDetailsResponse) {} rpc get_all_models(AccessibleModelsRequest) returns (AccessibleModelsResponse) {} From eb989cdd6ada4efb5503d3958a539ca3155f4887 Mon Sep 17 00:00:00 2001 From: Semyon Novikov Date: Tue, 27 Feb 2024 17:07:13 +0300 Subject: [PATCH 4/6] delete deprecated script and update readme --- README.md | 12 ++++-------- scripts/build-all | 15 ++++++++------- scripts/build-xgo | 37 ------------------------------------- 3 files changed, 12 insertions(+), 52 deletions(-) delete mode 100755 scripts/build-xgo diff --git a/README.md b/README.md index 2010650c..985171c7 100644 --- a/README.md +++ b/README.md @@ -24,20 +24,16 @@ These instructions are intended to facilitate the development and testing of Sin deploying SingularityNET services using SingularityNET Daemon should install the appropriate binary as [released](#release). -### Prerequisites +### Prerequisites and dependencies * [Go 1.21+](https://golang.org/dl/) * [NodeJS 15+ w/npm](https://nodejs.org/en/download/) - -### Dependencies - -* install [Protoc v25.0+](https://github.com/protocolbuffers/protobuf/releases) - -* If you want to cross-compile you will also need Docker +* [Protoc v25.0+](https://github.com/protocolbuffers/protobuf/releases) +* If you want to cross-compile you will also need Docker or run script `./build-all` ### Installing -* Clone the git repository to the following path $GOPATH/src/github.com/singnet/ +* Clone the git repository (for example $GOPATH/src/github.com/singnet/) ```bash $ git clone git@github.com:singnet/snet-daemon.git diff --git a/scripts/build-all b/scripts/build-all index 74364fce..9a47cc66 100644 --- a/scripts/build-all +++ b/scripts/build-all @@ -8,17 +8,18 @@ fi ./scripts/build darwin amd64 $1 ./scripts/build darwin arm64 $1 - ./scripts/build dragonfly amd64 $1 - ./scripts/build freebsd 386 $1 - ./scripts/build freebsd amd64 $1 - ./scripts/build freebsd arm $1 ./scripts/build linux 386 $1 ./scripts/build linux amd64 $1 ./scripts/build linux arm $1 ./scripts/build linux arm64 $1 - ./scripts/build netbsd amd64 $1 - ./scripts/build openbsd amd64 $1 - ./scripts/build windows 386 $1 ./scripts/build windows amd64 $1 ./scripts/build windows arm $1 ./scripts/build windows arm64 $1 + +# ./scripts/build windows 386 $1 +# ./scripts/build netbsd amd64 $1 +# ./scripts/build openbsd amd64 $1 +# ./scripts/build dragonfly amd64 $1 +# ./scripts/build freebsd 386 $1 +# ./scripts/build freebsd amd64 $1 +# ./scripts/build freebsd arm $1 diff --git a/scripts/build-xgo b/scripts/build-xgo deleted file mode 100755 index 37c28ab6..00000000 --- a/scripts/build-xgo +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -ex - -PARENT_PATH=$(dirname $(cd $(dirname $0); pwd -P)) -pushd $PARENT_PATH - -if [ $# -eq 0 ] - then - echo "Please pass the latest tagged version of the Daemon as an argument.The version passed will be used by the ldflags to set accordingly." - exit 1 -fi -# Make sure we have xgo -go get -u github.com/karalabe/xgo - - - -mkdir -p build - -# Stuck on Go 1.10.x until https://github.com/singnet/snet-daemon/issues/201 is resolved. -GO_VERSION=1.13.x - -# All targets compiled when Joel tried (2019-March), but we probably don't want to build them all! -#TARGETS=*/* - -# See here for details -# https://github.com/karalabe/xgo#limit-build-targets -now=$(date +'%Y-%m-%d_%T') -#latest version tag is passed as a param to this script. -TARGETS=linux/amd64,linux/arm-6,darwin-10.6/amd64,windows/amd64 -registryAddressJson=`cat resources/blockchain/node_modules/singularitynet-platform-contracts/networks/Registry.json|sed -r 's/["]+/\\"/g'|tr '\n' ' '` -networkJson=`cat resources/blockchain_network_config.json|tr '\n' ' '|sed -r 's/["]+/\\"/g'|sed 's/ //g'` -xgo -dest build -go $GO_VERSION -ldflags "-X github.com/singnet/snet-daemon/config.sha1Revision=`git rev-parse HEAD` - -X github.com/singnet/snet-daemon/config.versionTag=$1 - -X github.com/singnet/snet-daemon/config.buildTime=$now - -X github.com/singnet/snet-daemon/config.registryAddressJson=$registryAddressJson - -X github.com/singnet/snet-daemon/config.networkIdNameMapping=$networkJson " -targets=$TARGETS ./snetd From 091435c838f17cc929983f27ead9d7a2a4fa0d70 Mon Sep 17 00:00:00 2001 From: Semyon Novikov Date: Fri, 1 Mar 2024 13:34:03 +0300 Subject: [PATCH 5/6] update readme and refactor --- README.md | 27 +++++++++---------- .../configuration_service.go | 3 +-- .../configuration_service_test.go | 4 +-- go.mod | 2 +- go.sum | 2 ++ 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 985171c7..d0d767dc 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ deploying SingularityNET services using SingularityNET Daemon should install the * [Go 1.21+](https://golang.org/dl/) * [NodeJS 15+ w/npm](https://nodejs.org/en/download/) * [Protoc v25.0+](https://github.com/protocolbuffers/protobuf/releases) -* If you want to cross-compile you will also need Docker or run script `./build-all` + +Protoc, nodejs, go and go/bin should be in environment variables. ### Installing @@ -46,12 +47,16 @@ $ cd snet-daemon $ ./scripts/install ``` -* Build snet-daemon (on Linux amd64 platform), see below section if you want to cross compile instead. - Please note using ldflags, the latest tagged version , sha1 revision and the build time are set as part of the build. +* Build snet-daemon. Please note using ldflags, the latest tagged version , sha1 revision and the build time are set as part of the build. You need to pass the version as shown in the example below ```bash -$ ./scripts/build linux amd64 +$ ./scripts/build +``` + +Example: +```bash +$ ./scripts/build linux amd64 v5.1.2 ``` * Generate default config file snet-daemon (on Linux amd64 platform) @@ -62,20 +67,12 @@ $ ./build/snetd-linux-amd64 init **** Please update the registry address in daemon config based on the test network used -#### Cross-compiling +#### Multi-compiling -If you want to build snetd for platforms other than the one you are on, run `./scripts/build-xgo` instead +If you want to build snetd for several platforms, run `./scripts/build-all ` instead of `./scripts/build`. -You can edit the script to choose a specific platform, but by default it will build for Linux, OSX, and Windows (amd64 -for all, except Linux which will also build for arm6) - -Please note using ldflags the latest tagged version (passed as the first parameter to the script) , sha1 revision and -the build time are set as part of the build. - -```bash -$ ./scripts/build-xgo -``` +You can edit the script to choose a specific platforms, but by default it will build for Linux, OSX, and Windows #### Run Deamon diff --git a/configuration_service/configuration_service.go b/configuration_service/configuration_service.go index 66666194..ba8f0417 100644 --- a/configuration_service/configuration_service.go +++ b/configuration_service/configuration_service.go @@ -41,9 +41,8 @@ func getAuthenticationAddress() []common.Address { for _, user := range users { if !common.IsHexAddress(user) { fmt.Errorf("%v is not a valid hex address", user) - } else { - userAddress = append(userAddress, common.Address(common.BytesToAddress(common.FromHex(user)))) + userAddress = append(userAddress, common.BytesToAddress(common.FromHex(user))) } } return userAddress diff --git a/configuration_service/configuration_service_test.go b/configuration_service/configuration_service_test.go index de7210d4..b65188c7 100644 --- a/configuration_service/configuration_service_test.go +++ b/configuration_service/configuration_service_test.go @@ -17,10 +17,10 @@ func TestConfiguration_Service_checkAuthenticationAddress(t *testing.T) { config.Vip().Set(config.AuthenticationAddresses, []string{"0x4Af41abf4c6a4633B1574f05e74b802cBF42a96e", "0x06A1D29e9FfA2415434A7A571235744F8DA2a514", "0x94d04332C4f5273feF69c4a52D24f42a3aF1F207"}) service := ConfigurationService{authenticationAddressList: getAuthenticationAddress()} - err := service.checkAuthenticationAddress(common.Address(common.BytesToAddress(common.FromHex("0x39ee715b50e78a920120C1dED58b1a47F571AB75")))) + err := service.checkAuthenticationAddress(common.BytesToAddress(common.FromHex("0x39ee715b50e78a920120C1dED58b1a47F571AB75"))) assert.Equal(t, err.Error(), "unauthorized access, 0x39ee715b50e78a920120C1dED58b1a47F571AB75 is not authorized") //Pass an invalid hex authenticationAddressList - err = service.checkAuthenticationAddress(common.Address(common.BytesToAddress(common.FromHex("0x4Af41abf4c6a4633B1574f05e74b802cBF42a96e")))) + err = service.checkAuthenticationAddress(common.BytesToAddress(common.FromHex("0x4Af41abf4c6a4633B1574f05e74b802cBF42a96e"))) assert.Nil(t, err) } diff --git a/go.mod b/go.mod index 5b466cee..baad6ce8 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/OneOfOne/go-utils v0.0.0-20180319162427-6019ff89a94e github.com/coreos/pkg v0.0.0-20240122114842-bbd7aa9bf6fb github.com/emicklei/proto v1.13.2 - github.com/ethereum/go-ethereum v1.13.13 + github.com/ethereum/go-ethereum v1.13.14 github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/gorilla/handlers v1.5.2 diff --git a/go.sum b/go.sum index 39645df6..5ad5e746 100644 --- a/go.sum +++ b/go.sum @@ -211,6 +211,8 @@ github.com/ethereum/c-kzg-4844 v0.4.2 h1:99hCflha4YhQ2cW9H/X3QFv7vs78cCvSxOteEsT github.com/ethereum/c-kzg-4844 v0.4.2/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.13 h1:KYn9w7pEWRI9oyZOzO94OVbctSusPByHdFDPj634jII= github.com/ethereum/go-ethereum v1.13.13/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= +github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= +github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= From 9b1d7ce57e0e331b8397cadd8e1cb1d9a3b5a05e Mon Sep 17 00:00:00 2001 From: Semyon Novikov Date: Fri, 1 Mar 2024 13:39:48 +0300 Subject: [PATCH 6/6] update go.sum --- go.sum | 4 ---- 1 file changed, 4 deletions(-) diff --git a/go.sum b/go.sum index 5ad5e746..c60430ac 100644 --- a/go.sum +++ b/go.sum @@ -209,8 +209,6 @@ github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZ github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.2 h1:99hCflha4YhQ2cW9H/X3QFv7vs78cCvSxOteEsTvKnQ= github.com/ethereum/c-kzg-4844 v0.4.2/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.13 h1:KYn9w7pEWRI9oyZOzO94OVbctSusPByHdFDPj634jII= -github.com/ethereum/go-ethereum v1.13.13/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= @@ -1141,8 +1139,6 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg= golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=